Skip to main content
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:
VariableDescriptionExample
APP_SECRETSecret for JWT signingyour-secret-key
PG_DATABASE_URLPostgreSQL connection(Railway auto-generated)
REDIS_URLRedis connection(Railway auto-generated)
TWILIO_ACCOUNT_SIDTwilio Account SIDAC...
TWILIO_AUTH_TOKENTwilio Auth Token(from Twilio)
TWILIO_API_KEY_SIDTwilio API Key SIDSK...
TWILIO_API_KEY_SECRETTwilio API Key Secret(from Twilio)
FRONTEND_URLYour Railway URLhttps://your-app.up.railway.app
SERVER_URLServer URLhttps://your-app.up.railway.app:3000

Deployment Steps

1. Connect Repository

  1. Create a new Railway project
  2. Connect your GitHub repository
  3. Select the branch to deploy

2. Configure Environment

  1. Go to Variables tab
  2. Add all required environment variables
  3. Generate APP_SECRET using: openssl rand -base64 32

3. Deploy

  1. Click Deploy to trigger a build
  2. Wait for the build to complete
  3. Your app will be available at https://your-app.up.railway.app

Custom Domain

Add Domain

  1. Go to SettingsDomains
  2. Click Generate Domain for Railway-provided SSL
  3. Or add your own custom domain

Configure DNS

For custom domains:
TypeNameValue
CNAMEwwwyour-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