Deploy Krayin

Open-source CRM for leads, contacts, quotes and sales pipelines

Deploy Krayin

Just deployed

/var/www/krayin/storage

Just deployed

/data

Just deployed

/data

Just deployed

/var/lib/mysql

Deploy and Host Krayin on Railway

Krayin is a free, open-source CRM built on Laravel and Vue.js by Webkul, for sales teams that want to track leads through a pipeline without paying per seat: a drag-and-drop kanban of deals, a contact and organisation book, quotes built from a product catalogue, an email inbox threaded against each lead, and a log of calls, meetings and notes. Every field is a custom attribute, so you can shape leads, people and organisations around your own sales process. Teams self-host Krayin for Pipedrive-style pipeline management on infrastructure they control.

Deploy Krayin on Railway and this template brings up everything it needs: the krayin service running nginx, PHP-FPM, two queue workers and the Laravel scheduler in one container; MySQL for CRM data; Redis for sessions, cache and the job queue; and mailpit, an SMTP inbox catching everything Krayin sends, so quotes, password resets and lead emails work as soon as the deploy finishes. Browser traffic reaches nginx on the public domain, PHP talks to MySQL and Redis privately, and mail goes to mailpit on port 1025 — no public database, no install step.

Diagram of the Krayin, MySQL, Redis and Mailpit services on Railway

Getting Started with Krayin on Railway

Set ADMIN_EMAIL and ADMIN_PASSWORD before deploying — they become your first administrator account, and Krayin has no public sign-up, so they are the only way in. When the deploy goes green, open the public URL; it redirects to /admin/login. On first boot the container creates its own scoped MySQL role, runs the migrations, seeds the default pipeline, lead sources, types and email templates, and closes the web installer.

Start by creating a contact under Contacts → Persons, then Leads → Create Lead: attach that person through the contact lookup, give the lead a value, a source and a type, and save. The lead lands in the New column of the Default Pipeline; drag it to Follow Up and the totals update immediately, which proves the database, session store and pipeline all work. To check mail, use Forgot Password and open the mailpit URL — the reset message will be waiting, behind MP_UI_AUTH. Pipelines, stages, custom attributes and extra users live under Settings.

Krayin sales pipeline board with three leads across stages Krayin lead page showing its contact and stage changelog Krayin contacts grid listing three people with emails

About Hosting Krayin

Self-hosting Krayin makes sense when customer records are sensitive, when per-seat pricing has outgrown its value, or when you want to extend the CRM with your own modules — packages drop into packages/Webkul like the shipped ones.

  • Drag-and-drop sales pipelines with multiple stages and per-stage totals
  • Contacts and organisations, with custom attributes on each record
  • Quotes generated from a product catalogue and mailed as PDFs
  • A mail module threading inbound and outbound email against leads
  • Activities, workflow automation, tags, roles and a per-record changelog
  • CSV and XLSX import and export for leads, people and organisations

Inside the krayin service, nginx serves public/, PHP-FPM runs Laravel, two queue:work processes drain background jobs such as data imports, and schedule:work runs recurring tasks. mailpit shows captured mail in a password-protected inbox; point MP_SMTP_RELAY_* at a provider to forward it on.

Why Deploy Krayin on Railway

Railway removes the server work between you and a working CRM.

  • MySQL, Redis and the SMTP inbox are provisioned and wired together
  • The first admin, database role and schema are created on first boot
  • A private network keeps the database and mail off the internet
  • A persistent volume holds uploads and attachments across deploys
  • HTTPS, a public domain, scaling and redeploys need no tuning

Common Use Cases

  • A small sales team replacing spreadsheets with a shared pipeline where deals, contacts and email history live together
  • An agency running client-owned CRM instances, each with its own database and attributes
  • A product team extending a CRM with custom modules against its own API

Dependencies for Krayin

  • krayin — built from krayin/laravel-crm at tag v2.2.5 on the official php:8.3-fpm-bookworm image, with nginx and supervisor added. Source: gridalpha/krayin-railway.
  • MySQLmysql:9.4. Every lead, contact, quote, attribute and activity.
  • Redisredis:8.2. Sessions and cache on separate databases, plus the queue.
  • mailpitaxllent/mailpit:latest. Private SMTP on 1025, inbox on 8025.

Environment Variables Reference

VariableDescription
ADMIN_EMAIL / ADMIN_PASSWORDThe first administrator account
APP_KEY_SEEDSeed for Laravel's APP_KEY; keep it stable
APP_NAME / APP_CURRENCY / APP_TIMEZONE / APP_LOCALEBranding and regional defaults
DB_DATABASE / DB_USERNAME / DB_PASSWORDThe scoped MySQL role the app uses
MAIL_HOST / MAIL_PORT / MAIL_FROM_ADDRESSOutbound SMTP, aimed at mailpit
APP_ADMIN_PATHAdmin panel path prefix, default admin
MAIL_RECEIVER_DRIVERsendgrid, or webklex-imap with IMAP_* to poll a mailbox
QUEUE_WORKERSNumber of queue:work processes, default 2
MP_UI_AUTHuser:password guarding the mailpit inbox
APP_URLOverride only for a custom domain

Deployment Dependencies

Hardware Requirements for Self-Hosting Krayin

ResourceMinimumRecommended
CPU1 vCPU2 vCPU
RAM2 GB3–4 GB (upstream asks 3 GB)
Storage2 GB volume5 GB plus MySQL's volume
RuntimePHP 8.3, MySQL 8.0.32+PHP 8.3, MySQL 9, Redis 8

Self-Hosting Krayin

Upstream installs Krayin with Composer. These shell commands clone the project, install dependencies and run the interactive installer, which writes .env and creates the first admin:

git clone --depth 1 --branch v2.2.5 https://github.com/krayin/laravel-crm.git
cd laravel-crm
composer install --no-dev --optimize-autoloader
php artisan krayin-crm:install
php artisan serve

In a container the same steps run non-interactively once the database is reachable:

composer install --no-dev --prefer-dist --optimize-autoloader --no-scripts
php artisan krayin-crm:install --skip-env-check --skip-admin-creation --no-interaction
php artisan storage:link
php artisan config:cache
php artisan queue:work --tries=3 &
php artisan schedule:work

Run php artisan migrate --force on later boots rather than the installer, which is destructive. A self-hosted install also needs a web server in front of public/, a writable storage/, and MySQL and Redis reachable from the app.

How Much Does Krayin Cost to Self-Host?

Krayin Community is free and open source under the MIT licence, with no seat limits, feature gates or licence key. Webkul sells optional paid extensions and a hosted plan, but nothing here depends on either — the only cost is the compute, memory and volumes the four services use.

FAQ

What is Krayin?

Krayin is an open-source CRM built on Laravel and Vue.js by Webkul. It manages leads on a sales pipeline, along with contacts, organisations, quotes, products and their email and activity history.

What does this Railway template deploy?

Four services: Krayin running nginx, PHP-FPM, two queue workers and the scheduler; MySQL; Redis for sessions, cache and queues; and mailpit, a capture-only SMTP inbox. The schema, default pipeline and first administrator are created on first boot.

Why does the template include Redis and a mail service?

Redis keeps sessions and cache outside the container, so a redeploy does not sign everyone out, and it backs the queue the workers read. Mail is not optional in a CRM — quotes, lead emails and password resets all need SMTP — so mailpit makes those flows work immediately; swap in a real provider with MP_SMTP_RELAY_*.

How do I log in to self-hosted Krayin for the first time?

Open the public URL, which redirects to /admin/login, and sign in with the ADMIN_EMAIL and ADMIN_PASSWORD you set before deploying. There are no default credentials and no registration form; add colleagues under Settings → Users.

Can I import my existing leads and contacts?

Yes. Settings → Data Transfer imports leads, people, organisations and products from CSV or XLSX, and sample files ship with the deployment. Imports are queued, so the workers handle them in the background.

How do I connect a real mailbox so replies land against a lead?

Set MAIL_RECEIVER_DRIVER to webklex-imap and fill in IMAP_HOST, IMAP_PORT, IMAP_ENCRYPTION, IMAP_USERNAME and IMAP_PASSWORD. The scheduler then polls that mailbox every five minutes and threads matching messages onto the right lead.

How do I upgrade to a newer version of Krayin?

The build pins an upstream release tag. Change it in the source repository and redeploy; the container runs php artisan migrate --force on boot, so the schema follows. Back up MySQL first.


Template Content

More templates in this category

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

codestorm
47
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
51