---
title: "Deploy Krayin"
description: "Open-source CRM for leads, contacts, quotes and sales pipelines"
category: "Other"
url: https://railway.com/deploy/krayin-crm
---

# Deploy Krayin

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

**[Deploy Krayin on Railway](https://railway.com/template/krayin-crm)**

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

- **Creator:** A3A
- **Category:** Other

## Template content

### krayin https://raw.githubusercontent.com/krayin/laravel-crm/v2.2.5/packages/Webkul/Admin/src/Resources/assets/images/mobile-dark-logo.svg

- **Source:** https://github.com/gridalpha/krayin-railway
- **Health check:** /up
- **Public domain:** Yes

### Redis https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/redis.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### mailpit https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mailpit.svg

- **Image:** axllent/mailpit:latest
- **Health check:** /livez
- **Public domain:** Yes

### MySQL https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mysql.svg

- **Image:** mysql:9.4
- **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 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](https://res.cloudinary.com/rroe4rtk/image/upload/v1788783907/krayin-architecture.png)

## 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](https://res.cloudinary.com/rroe4rtk/image/upload/v1788783909/krayin-leads-pipeline.png)
![Krayin lead page showing its contact and stage changelog](https://res.cloudinary.com/rroe4rtk/image/upload/v1788783910/krayin-lead-detail.png)
![Krayin contacts grid listing three people with emails](https://res.cloudinary.com/rroe4rtk/image/upload/v1788783911/krayin-contacts-persons.png)

## 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](https://github.com/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](https://github.com/gridalpha/krayin-railway).
- **MySQL** — `mysql:9.4`. Every lead, contact, quote, attribute and activity.
- **Redis** — `redis:8.2`. Sessions and cache on separate databases, plus the queue.
- **mailpit** — `axllent/mailpit:latest`. Private SMTP on 1025, inbox on 8025.

### Environment Variables Reference

| Variable | Description |
|---|---|
| `ADMIN_EMAIL` / `ADMIN_PASSWORD` | The first administrator account |
| `APP_KEY_SEED` | Seed for Laravel's `APP_KEY`; keep it stable |
| `APP_NAME` / `APP_CURRENCY` / `APP_TIMEZONE` / `APP_LOCALE` | Branding and regional defaults |
| `DB_DATABASE` / `DB_USERNAME` / `DB_PASSWORD` | The scoped MySQL role the app uses |
| `MAIL_HOST` / `MAIL_PORT` / `MAIL_FROM_ADDRESS` | Outbound SMTP, aimed at mailpit |
| `APP_ADMIN_PATH` | Admin panel path prefix, default `admin` |
| `MAIL_RECEIVER_DRIVER` | `sendgrid`, or `webklex-imap` with `IMAP_*` to poll a mailbox |
| `QUEUE_WORKERS` | Number of `queue:work` processes, default 2 |
| `MP_UI_AUTH` | `user:password` guarding the mailpit inbox |
| `APP_URL` | Override only for a custom domain |

### Deployment Dependencies

- Source: [github.com/krayin/laravel-crm](https://github.com/krayin/laravel-crm)
- Docs: [devdocs.krayincrm.com](https://devdocs.krayincrm.com/)
- Runtime: PHP 8.3, Laravel 12, Vue 3, MySQL 9, Redis 8

## Hardware Requirements for Self-Hosting Krayin

| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 2 GB | 3–4 GB (upstream asks 3 GB) |
| Storage | 2 GB volume | 5 GB plus MySQL's volume |
| Runtime | PHP 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.


## 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) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/krayin-crm
