Deploying Posio
Introduction
Posio is a self-hosted, open-source multiplayer geography guessing game inspired by GeoGuessr. Players are shown a location on a map and must guess where in the world it is, earning points based on the accuracy of their guesses. The game supports multiple players competing in real-time, making it perfect for friends, families, or educational settings.
Built with modern web technologies, Posio offers a lightweight and fast gaming experience without requiring subscriptions or accounts. The self-hosted nature means you control your data and can customize the experience for your needs.
Key highlights of Posio:
- Multiplayer Support: Challenge friends to real-time geography competitions
- No Account Required: Jump straight into games without registration
- Customizable Rounds: Configure the number of rounds and time limits
- Score Tracking: Track points based on guess accuracy
- Mobile Friendly: Play on any device with a web browser
- Lightweight: Minimal resource requirements for hosting
- Open Source: Licensed under MIT with full source code access
This guide walks through deploying Posio on Klutch.sh using Docker.
Why Deploy Posio on Klutch.sh
Deploying Posio on Klutch.sh provides several advantages:
Simplified Deployment: Klutch.sh automatically detects your Dockerfile and builds Posio without complex configuration. Push to GitHub, and your game server deploys automatically.
HTTPS by Default: Klutch.sh provides automatic SSL certificates, ensuring secure connections for all players.
GitHub Integration: Connect your repository directly from GitHub. Updates trigger automatic redeployments.
Scalable Resources: Allocate CPU and memory based on expected player counts.
Custom Domains: Assign a custom domain for a branded gaming experience.
Always-On Availability: Your game server remains accessible 24/7 for players worldwide.
Prerequisites
Before deploying Posio on Klutch.sh, ensure you have:
- A Klutch.sh account
- A GitHub account with a repository for your Posio configuration
- Basic familiarity with Docker and containerization concepts
- (Optional) A custom domain for your Posio instance
Preparing Your Repository
Create a GitHub repository containing your Dockerfile for Posio deployment.
Repository Structure
posio-deploy/├── Dockerfile└── .dockerignoreCreating the Dockerfile
Create a Dockerfile in the root of your repository:
FROM node:18-alpine
WORKDIR /app
# Clone Posio repositoryRUN apk add --no-cache git && \ git clone https://github.com/abrenaut/posio.git . && \ npm install && \ npm run build
# Set environment variablesENV NODE_ENV=productionENV PORT=3000
EXPOSE 3000
CMD ["npm", "start"]Creating the .dockerignore File
Create a .dockerignore file:
.git.github*.mdLICENSE.gitignore*.log.DS_Storenode_modules/Deploying Posio on Klutch.sh
- Select HTTP as the traffic type
- Set the internal port to 3000
- Detect your Dockerfile automatically
- Build the container image
- Start the Posio container
- Provision an HTTPS certificate
Push Your Repository to GitHub
Initialize your repository and push to GitHub:
git initgit add Dockerfile .dockerignoregit commit -m "Initial Posio deployment configuration"git remote add origin https://github.com/yourusername/posio-deploy.gitgit push -u origin mainCreate a New Project on Klutch.sh
Navigate to the Klutch.sh dashboard and create a new project. Give it a descriptive name like “posio” or “geography-game”.
Create a New App
Within your project, create a new app. Connect your GitHub account if you haven’t already, then select the repository containing your Posio Dockerfile.
Configure HTTP Traffic
In the deployment settings:
Deploy Your Application
Click Deploy to start the build process. Klutch.sh will:
Access Posio
Once deployment completes, access your Posio instance at https://your-app-name.klutch.sh. Start a new game and share the link with friends to play together.
Playing Posio
Starting a Game
- Navigate to your Posio instance
- Click “Create Game” to start a new session
- Share the game URL with friends
- Wait for players to join
- Start the game when everyone is ready
Game Rules
- Each round displays a location on the map
- Players click where they think the location is
- Points are awarded based on distance from the actual location
- The player with the most points after all rounds wins
Troubleshooting Common Issues
Game Not Loading
Solutions:
- Verify the deployment is running in the Klutch.sh dashboard
- Check browser console for JavaScript errors
- Ensure WebSocket connections are working
Players Cannot Join
Solutions:
- Share the complete game URL including the game ID
- Verify all players can access the instance URL
- Check that the game hasn’t already started
Additional Resources
Conclusion
Deploying Posio on Klutch.sh gives you a fun, self-hosted geography game that you can share with friends and family. The simple deployment process and always-on availability make it easy to host your own GeoGuessr-style gaming sessions without subscriptions or third-party dependencies.