---
title: "Deploy EspoCRM"
description: "EspoCRM 10 CRM with job daemon, WebSockets and MySQL, on volumes"
category: "Other"
url: https://railway.com/deploy/espocrm-1
---

# Deploy EspoCRM

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

**[Deploy EspoCRM on Railway](https://railway.com/template/espocrm-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/espocrm-1/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Other
- **Total deploys:** 2

## Template content

### EspoCRM https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/espocrm.png

- **Source:** https://github.com/aalfath/espocrm-railway-template
- **Health check:** /
- **Public domain:** Yes

### MySQL https://devicons.railway.app/i/mysql.svg

- **Image:** mysql:8
- **Start command:** `docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=1G`

## Documentation

# 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

* EspoCRM Docker image: https://hub.docker.com/r/espocrm/espocrm
* EspoCRM Docker installation docs: https://docs.espocrm.com/administration/docker/installation/
* EspoCRM releases: https://github.com/espocrm/espocrm/releases
* Template source: https://github.com/aalfath/espocrm-railway-template

### Implementation Details

**Services**

| Service | What it does | Volume |
|---|---|---|
| EspoCRM | Apache + 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/`) |
| MySQL | Database, 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 &gt; 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**

| Variable | Default | Notes |
|---|---|---|
| `ESPOCRM_ADMIN_USERNAME` | `admin` | Username of the first admin, used on first boot only |
| `ESPOCRM_ADMIN_PASSWORD` | generated | Password of the first admin, used on first boot only. Change it in EspoCRM afterwards |
| `ESPOCRM_SITE_URL` | your Railway domain | Set 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 service | Leave as they are |
| `PORT` | `8080` | Port 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.



## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — Self-hosted virtual tabletop for role-playing games (license required)
- [Double Commander in your browser](https://railway.com/deploy/double-commander-in-your-browser) — The Double Commander file manager in the cloud, from any device

Open this page in a browser: https://railway.com/deploy/espocrm-1
