4.0 KiB
Deploy AgentForge (public MVP) — Railway
Use Railway to get a public URL so your agent can call the API.
Railway steps
-
Push this repo to GitHub (if not already).
-
Create project
railway.app → New Project → Deploy from GitHub → select this repo.
Railway uses the rootDockerfileandrailway.toml. -
Add Postgres
In the same project: + New → Database → PostgreSQL.
Open the Postgres service → Variables (or Connect) → copyDATABASE_URL(or the connection URL). -
Add Redis
+ New → Database → Redis.
Open the Redis service → Variables → note Host, Port, Password (or the connection URL). -
Generate public URL
Open your app service (the one from the repo) → Settings → Networking → Generate Domain.
Copy the URL (e.g.https://agentforge-production.up.railway.app). -
Set app env vars
App service → Variables → Add variable (or RAW Editor). Add:Variable Where to get it DATABASE_URLPostgres service → Variables / Connect REDIS_HOSTRedis service → Variables (host) REDIS_PORTRedis service → Variables (port, e.g. 6379) REDIS_PASSWORDRedis service → Variables (password; can leave empty if none) JWT_SECRET_KEYAny long random string (e.g. openssl rand -hex 32)ACCESS_TOKEN_SALTAnother long random string ROOT_URLThe URL from step 5 (e.g. https://agentforge-production.up.railway.app)Tip: For Postgres/Redis, Railway can “Reference” variables from the other services so you don’t copy-paste secrets.
-
Deploy
Save variables; Railway redeploys. Wait for the deploy to finish. -
Create first user
Open ROOT_URL in a browser → Get started → create an account (this user is admin). -
Get token for the agent
In the app: open that user’s Account / Settings → copy the security token. -
Agent auth
POST <ROOT_URL>/api/v1/auth/anonymous- Body:
{ "accessToken": "<security_token>" } - Use the returned authToken as
Authorization: Bearer <authToken>on all API requests.
Alternative: Render
- Push to GitHub.
- Render Dashboard → New → Blueprint → connect repo (uses
render.yaml). - Deploy Blueprint; when prompted, leave REDIS_PASSWORD and ROOT_URL blank for now.
- After deploy: set ROOT_URL in the web service env to your Render URL → Save.
- Open the URL → create first user → copy security token → use
POST .../api/v1/auth/anonymousand Bearer token as above.
Env reference
| Variable | Required | Notes |
|---|---|---|
DATABASE_URL |
Yes | Postgres connection URL. |
REDIS_HOST |
Yes | Redis host. |
REDIS_PORT |
Yes | Usually 6379. |
REDIS_PASSWORD |
No* | Leave empty if Redis has no auth. |
JWT_SECRET_KEY |
Yes | Long random string. |
ACCESS_TOKEN_SALT |
Yes | Long random string. |
ROOT_URL |
Yes | Your app’s public URL (set after first deploy). |
* App allows empty; required only if your Redis has a password.