Railway provides a simple way to deploy Consuelo with automatic builds and HTTPS.
Prerequisites
- Railway account
- Twilio account with voice credentials
- PostgreSQL database (Railway provides this)
- Redis instance (Railway provides this)
Dockerfile
Create a Dockerfile in your project root:
FROM node:20-alpine
WORKDIR /app
COPY package.json yarn.lock ./
COPY packages/twenty-shared ./packages/twenty-shared
COPY packages/twenty-server ./packages/twenty-server
COPY packages/twenty-front ./packages/twenty-front
COPY packages/dialer ./packages/dialer
COPY packages/contacts ./packages/contacts
COPY packages/coaching ./packages/coaching
COPY packages/api ./packages/api
RUN yarn install --frozen-lockfile
RUN yarn build twenty-shared
RUN yarn build twenty-server
RUN yarn build twenty-front
EXPOSE 3000
CMD ["yarn", "start:prod"]
Environment Variables
Configure these in Railway:
| Variable | Description | Example |
|---|
APP_SECRET | Secret for JWT signing | your-secret-key |
PG_DATABASE_URL | PostgreSQL connection | (Railway auto-generated) |
REDIS_URL | Redis connection | (Railway auto-generated) |
TWILIO_ACCOUNT_SID | Twilio Account SID | AC... |
TWILIO_AUTH_TOKEN | Twilio Auth Token | (from Twilio) |
TWILIO_API_KEY_SID | Twilio API Key SID | SK... |
TWILIO_API_KEY_SECRET | Twilio API Key Secret | (from Twilio) |
FRONTEND_URL | Your Railway URL | https://your-app.up.railway.app |
SERVER_URL | Server URL | https://your-app.up.railway.app:3000 |
Deployment Steps
1. Connect Repository
- Create a new Railway project
- Connect your GitHub repository
- Select the branch to deploy
- Go to Variables tab
- Add all required environment variables
- Generate
APP_SECRET using: openssl rand -base64 32
3. Deploy
- Click Deploy to trigger a build
- Wait for the build to complete
- Your app will be available at
https://your-app.up.railway.app
Custom Domain
Add Domain
- Go to Settings → Domains
- Click Generate Domain for Railway-provided SSL
- Or add your own custom domain
For custom domains:
| Type | Name | Value |
|---|
| CNAME | www | your-app.up.railway.app |
| ALIAS | @ | your-app.up.railway.app |
Allow up to 24 hours for SSL certificates to provision after adding a custom
domain.
Troubleshooting
Build Fails
- Check that all workspace packages are copied in Dockerfile
- Ensure yarn.lock is up to date
502 Errors
- Check that the server is listening on port 3000
- Verify
SERVER_URL matches your Railway URL
Database Connection Errors
- Verify
PG_DATABASE_URL is set correctly
- Check Railway database is active
Twilio Webhooks Not Working
- Ensure
FRONTEND_URL is publicly accessible
- Verify Twilio console has correct webhook URLs