Deploy EspoCRM (Self-Hosted CRM, Salesforce Alternative)

Self-hosted EspoCRM with MySQL, live notifications and file storage.

Deploy EspoCRM (Self-Hosted CRM, Salesforce Alternative)

Just deployed

/data

Just deployed

/var/lib/mysql

espocrm-files

Bucket

Just deployed

Deploy and Host EspoCRM on Railway

EspoCRM logo

EspoCRM is a fast, open-source CRM for managing leads, contacts, accounts, opportunities, cases, emails and calendars, with a clean interface and a flexible entity builder. This template runs the official EspoCRM image on Railway with MySQL, the background job daemon, real-time WebSocket notifications and a Railway Bucket for attachments, all ready from the first deploy. Salesforce Starter costs $25 per user per month, and EspoCRM's own cloud starts at $15 per user. Self-hosted EspoCRM has no per-user fees and runs for about $12–20/month for your whole team.


What This Template Deploys

ServicePurpose
espocrmThe EspoCRM web app (PHP and Apache) on port 80 with a public HTTPS domain. The job daemon and the WebSocket server run alongside it in the same container.
MySQLMySQL 9.4 with EspoCRM's own database and a least-privilege user, created at first boot.
Persistent VolumeMounted at /data on espocrm for config, customisations made in the UI, extensions and logs.
BucketA Railway Bucket (espocrm-files) for attachments and documents.

EspoCRM 10 normally needs three separate folders mounted, plus separate containers for the daemon and WebSocket server. Railway allows one volume per service, so this template keeps all three folders on one volume and runs every EspoCRM process together, the same shape as a single-server install.


About Hosting EspoCRM

A production EspoCRM install needs PHP and Apache, a MySQL database with its own user, a cron-style job runner for emails, reminders and workflows, a WebSocket server for live notifications, persistent storage for customisations, and HTTPS. Upstream's docker-compose setup spreads these across several containers and shared folders, which most PaaS hosts can't do.

This template packs them into one service that behaves like a well-run single server. Apache proxies /wss to the WebSocket server, so notifications appear instantly. The job daemon runs continuously, so scheduled jobs and inbound email work without extra setup. The database and user are created idempotently at boot, Apache's worker count follows the container's memory, and HSTS is enabled. On Railway, you also get automatic HTTPS and attachments in managed object storage.

Your admin password is generated. Sign in as admin with ESPOCRM_ADMIN_PASSWORD from the espocrm service's Variables tab, then change it in your profile.

Typical cost: ~$12–20/month on Railway for EspoCRM and MySQL, which is tuned with a 1 GB buffer pool for speed. Ten users on Salesforce Starter cost $250/month.


Deploy EspoCRM in Under 10 Minutes

  1. Click Deploy on Railway. MySQL starts, the database and user are created, and EspoCRM installs itself (about 3–5 minutes).
  2. Copy ESPOCRM_ADMIN_PASSWORD from the espocrm service's Variables tab.
  3. Open your Railway URL and sign in as admin. Then change the password.
  4. Under Administration, Settings, set your timezone, currency and date format.
  5. Add users and roles, import your contacts and accounts from CSV, and connect email accounts.

No cron setup. No separate WebSocket container. No per-user subscription.


Common Use Cases

  • Self-hosted Salesforce alternative. Leads, accounts, contacts, opportunities and forecasting without per-seat pricing.
  • Sales pipeline management. Track deals through stages with kanban views and reports.
  • Customer support. Cases, a knowledge base and email-to-case for support teams.
  • Email and calendar in the CRM. Connect IMAP/SMTP accounts, log emails and schedule meetings and calls.
  • Custom business apps. Use the Entity Manager to add your own entities, fields, layouts and relationships.
  • Workflow automation. Automate assignments, reminders and follow-ups (some advanced workflows are paid extensions).
  • Agencies and consultants. One CRM for many clients, with roles and teams controlling access.
  • Privacy-sensitive industries. Keep customer data on your own infrastructure.

Configuration

VariableRequiredDescription
ESPOCRM_ADMIN_USERNAME✅ Setadmin, created on first boot.
ESPOCRM_ADMIN_PASSWORD🔐 Auto-generatedFirst admin password. Change it in the UI afterwards.
ESPOCRM_SITE_URL, ESPOCRM_CONFIG_SITE_URL✅ Auto-injectedYour public URL, used in links and emails.
ESPOCRM_DATABASE_HOST, _PORT, _NAME, _USER, _PASSWORD✅ Auto-injectedEspoCRM's own MySQL database and user.
ESPOCRM_DATABASE_ADMIN_URL✅ Auto-injectedMySQL superuser URL, used at boot to create the database and user.
ESPOCRM_S3_BUCKET, _REGION, _ENDPOINT, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY✅ Auto-injectedThe Railway Bucket for attachments.
ESPOCRM_TIME_ZONEOptionalUTC. Set your zone, for example America/New_York.
ESPOCRM_CONFIG_USE_WEB_SOCKET✅ Settrue for real-time notifications.
ESPOCRM_CONFIG_LOGGER__PATH, __ROTATION, __PRINT_TRACE✅ SetLog file, rotation and stack traces.

Any EspoCRM setting can be set with the image's ESPOCRM_CONFIG_* convention. Settings you change through the Administration UI are saved on the /data volume.

Email on the Hobby plan. Railway blocks outbound SMTP on Hobby, so sending email from EspoCRM needs Railway Pro or an email provider with an alternative port. Inbound IMAP fetching works on any plan.

Using a custom domain? Add it to the espocrm service, then update ESPOCRM_SITE_URL and ESPOCRM_CONFIG_SITE_URL and redeploy.


EspoCRM on Railway vs. Alternatives

EspoCRM on RailwaySalesforce Sales CloudEspoCRM CloudSuiteCRM (self-hosted)
Monthly cost~$12–20 usage, any number of users$25 per user (Starter), $100 (Pro)$15 per user (3 minimum)Hosting only
Self-hosted✅ Yes❌ No❌ Hosted by EspoCRM✅ Yes
Per-user fees✅ None❌ Per user❌ Per user✅ None
Real-time notifications✅ WebSocket included✅ Yes✅ Yes⚠️ Limited
Custom entities and fields✅ Entity Manager✅ Yes✅ Yes✅ Studio
Your data on your server✅ Your MySQL❌ Hosted❌ Hosted✅ Yes
License✅ AGPL-3.0❌ Proprietary✅ AGPL-3.0 core, hosted✅ AGPL-3.0

Dependencies for EspoCRM Hosting

  • Railway account. Hobby works for small teams; Pro for outbound email and larger teams.
  • Email accounts (IMAP/SMTP) if you want email in the CRM.
  • Your existing contacts and accounts, exported as CSV, to import.

Deployment Dependencies

Implementation Details

The official espocrm/espocrm image runs unchanged. The wrapper links data, custom and client/custom into the single /data volume and seeds them from the image on first boot. It supervises Apache, the job daemon and the WebSocket server together, and runs bootstrap-db.php to create the database and user. After installation, attachment storage is switched to the Railway Bucket.

Upgrades follow EspoCRM's image releases. Back up MySQL and the /data volume before a major version upgrade.


Frequently Asked Questions

What is EspoCRM? An open-source CRM for sales, support and marketing, with leads, contacts, accounts, opportunities, cases, email and calendars, plus tools for adding your own entities and fields.

How much does it cost compared to Salesforce? About $12–20/month on Railway for any number of users. Salesforce Starter is $25 per user per month and Pro is $100, so ten users cost $250–1,000/month.

Why don't notifications appear in real time? They come through the WebSocket server at /wss, which this template runs and proxies. If you add a custom domain, update both site URL variables and redeploy so the browser connects to the right address.

Do I lose data or customisations when Railway redeploys? No. Records are in MySQL on its volume, customisations and config are on the /data volume, and attachments are in the Railway Bucket.

Can I send email from EspoCRM? Yes, through any SMTP account. On Railway's Hobby plan outbound SMTP is blocked, so use Railway Pro or a provider that offers an alternative port.

Are EspoCRM extensions supported? Yes. Install free or paid extensions (such as Advanced Pack or Sales Pack) from Administration, Extensions. They're stored on the volume and survive redeploys.


Why Deploy and Host 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 get a complete self-hosted CRM with background jobs, live notifications and attachment storage, for one flat cost however many users you add.


Template Content

espocrm-files

Bucket

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
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
52