Deploy EspoCRM

EspoCRM 10 CRM with job daemon, WebSockets and MySQL, on volumes

Deploy EspoCRM

/espocrm-storage

MySQL

mysql:8

Just deployed

/var/lib/mysql

Deploy and Host EspoCRM on Railway

EspoCRM is an open-source CRM (AGPL-3.0) for managing accounts, contacts, leads, opportunities, cases, emails, calendars and workflows. It has a single-page web interface, a REST API, roles and team permissions, and an Entity Manager for adding your own fields, entities and layouts without code.

About Hosting EspoCRM

Running EspoCRM properly takes more than the web app. Upstream's Docker setup has four parts: the PHP web app, a job daemon that runs scheduled jobs (email fetching, reminders, notifications, mass email), a WebSocket server for live updates, and a MySQL or MariaDB database. The three EspoCRM processes must share the same data/, custom/ and client/custom/ folders. This template runs them together in one EspoCRM service on a single Railway volume, puts MySQL in its own service with its own volume, generates the database and admin passwords, sets the site URL from the Railway domain, and proxies the WebSocket server through the public HTTPS domain.

Common Use Cases

  • Sales pipeline and lead management for a small or mid-sized team
  • Customer support with cases, a knowledge base and inbound email
  • A self-hosted, customisable alternative to Salesforce, HubSpot or Zoho CRM

Dependencies for EspoCRM Hosting

  • EspoCRM 10.1.3 (official espocrm/espocrm Apache image, pinned by digest), running the web app, job daemon and WebSocket server
  • MySQL (Railway's MySQL service) on its own volume

Deployment Dependencies

Implementation Details

Services

ServiceWhat it doesVolume
EspoCRMApache + PHP web app on PORT (8080), the job daemon (daemon.php) and the WebSocket server (websocket.php, proxied on /wss)/espocrm-storage (holds data/, custom/, client/custom/)
MySQLDatabase, reached over the private network/var/lib/mysql

After deploy

  1. Wait for the EspoCRM service to turn healthy (the first boot installs the database, about 1 to 2 minutes).
  2. Open the EspoCRM service's Variables tab and copy ESPOCRM_ADMIN_PASSWORD (generated for you).
  3. Log in at your Railway domain as admin with that password, then change the password under your profile.
  4. Optional: set up outbound email under Administration > Outbound Emails, and inbound email accounts if you want email-to-case or email fetching. The job daemon is already running, so scheduled jobs need no cron setup.

Variables

VariableDefaultNotes
ESPOCRM_ADMIN_USERNAMEadminUsername of the first admin, used on first boot only
ESPOCRM_ADMIN_PASSWORDgeneratedPassword of the first admin, used on first boot only. Change it in EspoCRM afterwards
ESPOCRM_SITE_URLyour Railway domainSet to https://YOUR-DOMAIN when you add a custom domain; links and WebSockets follow it on the next deploy
ESPOCRM_DATABASE_*references to the MySQL serviceLeave as they are
PORT8080Port Apache listens on

Any EspoCRM config setting can be set with an ESPOCRM_CONFIG_* variable, as in the official image (for example ESPOCRM_CONFIG_TIME_ZONE=Europe/Berlin).

Updates

The EspoCRM service builds from this repository. When a new EspoCRM version is pinned here, Railway shows "update available" on your project and you choose when to apply it. On the next start the official entrypoint runs EspoCRM's migrations. Read CHANGELOG.md before you update, and back up the MySQL volume first.

Why Deploy EspoCRM on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying EspoCRM on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
51
View Template
Foundry Virtual Tabletop
Self-hosted virtual tabletop for role-playing games (license required)

Lucas
71
View Template
NEW
Double Commander in your browser
The Double Commander file manager in the cloud, from any device

Nermin Sabanovic
0