Spaces:
Runtime error
Runtime error
Deploying Neta Khoj to Railway
This guide will help you host your application on Railway, a modern hosting platform that supports Node.js, WebSockets, and Puppeteer out of the box.
Prerequisites
- A GitHub account.
- A Railway account (login with GitHub).
- This project pushed to a GitHub repository.
One-Click Deployment
The easiest way to deploy is to use the button below. It will clone this repository to your GitHub and deploy it to Railway.
Note: You will need to select your repository after clicking the button.
Manual Deployment Steps
- Login to Railway: Go to railway.app and log in.
- New Project: Click "New Project" > "Deploy from GitHub repo".
- Select Repository: Choose your
fixKaroWebrepository. - Deploy: Railway will automatically detect the
railway.jsonfile and start building.
Configuration (Environment Variables)
Once the project is created, go to the Variables tab in your Railway project dashboard and add the following:
| Variable | Value | Description |
|---|---|---|
ADMIN_TOKEN |
your-secret-password |
Required. Password for admin actions. |
NODE_ENV |
production |
Optimizes the app for performance. |
LOG_TO_FILE |
false |
Railway captures console logs automatically. |
MAX_BROWSERS |
3 |
Limit Puppeteer instances to save memory. |
MAX_WS_CONNECTIONS_PER_IP |
10 |
WebSocket rate limiting. |
Domain Setup
- Go to the Settings tab in Railway.
- Under Networking, click "Generate Domain".
- You will get a URL like
fixkaro-web-production.up.railway.app. - Important: Copy this URL.
- Go back to Variables and add:
ALLOWED_ORIGINS:https://your-generated-url.up.railway.app(Replace with your actual URL).
Troubleshooting
- Build Failed? Check the "Build Logs". This project uses
Nixpacksto install Chromium for Puppeteer. Ensurerailway.jsonis present in your repo. - App Crashing? Check "Deploy Logs". If you see memory errors, try reducing
MAX_BROWSERSto1. - WebSockets not connecting? Ensure you are using
wss://(Secure WebSocket) and that yourALLOWED_ORIGINSmatches your domain exactly.