Make sure all files are committed to git:
git add .
git commit -m "Ready for deployment"Option A: Using Railway CLI (Easiest)
- Install Railway CLI:
npm i -g @railway/cli - Login:
railway login - Initialize:
railway init - Deploy:
railway up - Get your URL:
railway status
Option B: Using Railway Dashboard
- Go to railway.app
- Create account and login
- Click "New Project" → "Deploy from GitHub repo"
- Connect your GitHub repository
- Railway will automatically detect it's a Node.js app
- Deploy and get your URL
Once deployed, you'll get a URL like: https://your-game-name.railway.app
Share this URL with friends to play together online!
- Go to render.com
- Create account and connect GitHub
- Create new "Web Service"
- Select your repository
- Set build command:
npm install - Set start command:
npm start - Deploy and get URL
- Install Heroku CLI
- Login:
heroku login - Create app:
heroku create your-game-name - Deploy:
git push heroku main - Open:
heroku open
- Open your deployed URL in a browser
- Test the game works locally
- Open the same URL in another browser/device
- Verify multiplayer works (you should see both players)
- Port issues: Railway/Render automatically handle ports
- WebSocket errors: Make sure your platform supports WebSockets
- Connection issues: Check the browser console for errors
- Railway: Free tier available, then $5/month
- Render: Free tier available
- Heroku: Free tier discontinued, paid plans only
Railway is recommended for its simplicity and good free tier!