
Deploy Krayin CRM | Free Open Source Salesforce Alternative
Self-host Krayin CRM on Railway with MySQL — free, open-source Laravel CRM
MySQL
Just deployed
/var/lib/mysql
Krayin
Just deployed
/var/www/laravel-crm/storage/app
Deploy and Host Krayin CRM on Railway
Deploy Krayin CRM on Railway to run a fully self-hosted, open-source customer relationship management system with zero per-user licensing fees. Self-host Krayin CRM and manage your entire sales pipeline — leads, contacts, activities, quotations, and products — all under your own infrastructure.
This Railway template deploys Krayin CRM (webkul/krayin:2.2.0) with a MySQL database, pre-configured with Nginx, PHP-FPM, automated database migrations, and a production-ready setup.
Getting Started with Krayin CRM on Railway
After deployment completes, navigate to your Railway-generated URL with /admin/login appended. Sign in with the default admin credentials:
- Email: [email protected]
- Password: admin123
Change the admin password immediately under Settings > Users. From there, create your first sales pipeline by navigating to Settings > Pipelines and defining your deal stages (e.g., Qualified, Proposal, Negotiation, Won). Add your first lead by clicking Leads > Create Lead and watch it flow through your pipeline.
Configure email integration under Settings > Email to start receiving customer communications directly in the CRM inbox. Set up additional users and roles under Settings > Users and Settings > Roles to control team access.

About Hosting Krayin CRM
Krayin CRM is a free, MIT-licensed Laravel CRM built by Webkul for SMEs and enterprises. With 22,100+ GitHub stars, it provides complete customer lifecycle management through a modern Vue.js interface backed by PHP 8.3 and MySQL.
Key features:
- Lead & Pipeline Management — drag-and-drop kanban boards with deal probability and stage tracking
- Contact & Organization Management — full interaction history, communication logs, company hierarchies
- Activity Tracking — calls, meetings, emails, notes, and tasks linked to contacts and leads
- Quotation & Product Catalog — generate price quotes tied to products and deals
- Email Integration — inbound email parsing via SendGrid, outbound campaigns, CRM inbox
- Workflow Automation — event-driven triggers and automated actions
- REST API & Webhooks — full CRUD API for all entities with outbound webhook support
- AI Lead Extraction — create leads automatically from uploaded PDFs and images
- Role-Based Access Control — granular permissions per module and user role
- Custom Attributes — add custom fields (text, select, date, price, multi-select) to any entity
Why Deploy Krayin CRM on Railway
- Zero per-user licensing — MIT license, unlimited users at no software cost
- One-click deployment with MySQL, Nginx, and PHP-FPM pre-configured
- Full data sovereignty — your CRM data stays on your infrastructure
- Scales with Railway's autoscaling — no manual server management
- Laravel/PHP stack familiar to millions of developers
Common Use Cases for Self-Hosted Krayin CRM
- Sales teams tracking leads through multi-stage pipelines with real-time deal visibility
- Agencies managing client relationships, communication history, and project quotations
- SMBs replacing expensive Salesforce/HubSpot subscriptions with a zero-cost self-hosted alternative
- Developers building custom CRM workflows via the REST API and webhook integrations
Dependencies for Krayin CRM on Railway
- Krayin CRM —
webkul/krayin:2.2.0(PHP 8.3 + Nginx + Supervisord) - MySQL — Railway-managed MySQL 8.0 (persistent storage included)
Environment Variables Reference for Krayin CRM
| Variable | Value | Description |
|---|---|---|
APP_URL | https:// | Public-facing URL of the CRM |
APP_KEY | base64: | Laravel encryption key (static, do not change) |
APP_ENV | production | Application environment |
DB_HOST | ${{MySQL.MYSQLHOST}} | MySQL host via Railway reference |
DB_DATABASE | ${{MySQL.MYSQLDATABASE}} | MySQL database name |
MYSQL_AUTOSTART | false | Disables built-in MySQL (using external) |
TRUSTED_PROXIES | * | Trust Railway's reverse proxy for HTTPS detection |
CACHE_DRIVER | file | Cache backend |
SESSION_DRIVER | file | Session backend |
Deployment Dependencies
- Runtime: PHP 8.3, Nginx, Supervisord
- Docker Hub: webkul/krayin
- GitHub: krayin/laravel-crm (22.1k stars, MIT license)
- Docs: devdocs.krayincrm.com
Hardware Requirements for Self-Hosting Krayin CRM
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 vCPU | 2 vCPU |
| RAM | 1 GB | 2 GB |
| Storage | 5 GB | 20 GB |
| Runtime | PHP 8.1+, MySQL 8.0+ | PHP 8.3, MySQL 8.0.32+ |
Self-Hosting Krayin CRM with Docker
Pull and run the official Docker image with an external MySQL database:
docker run -d \
--name krayin \
-p 80:80 \
-e DB_HOST=your-mysql-host \
-e DB_PORT=3306 \
-e DB_DATABASE=krayin \
-e DB_USERNAME=root \
-e DB_PASSWORD=your-password \
-e APP_URL=https://your-domain.com \
-e APP_KEY=base64:$(openssl rand -base64 32) \
-e MYSQL_AUTOSTART=false \
webkul/krayin:2.2.0
Or use Docker Compose with the official repository:
# docker-compose.yml
services:
krayin:
image: webkul/krayin:2.2.0
ports:
- "80:80"
environment:
DB_HOST: krayin-mysql
DB_DATABASE: krayin
DB_USERNAME: krayin
DB_PASSWORD: krayin
APP_URL: http://localhost
depends_on:
- krayin-mysql
krayin-mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: krayin
MYSQL_USER: krayin
MYSQL_PASSWORD: krayin
volumes:
- mysql-data:/var/lib/mysql
volumes:
mysql-data:
How Much Does Krayin CRM Cost to Self-Host?
Krayin CRM is completely free and open-source under the MIT license. There are no per-user fees, no tier limits, and no feature gates on the core CRM. Premium extensions (WhatsApp integration at $1,499, VoIP at $4,500) are available as one-time purchases from Webkul. On Railway, you pay only for infrastructure — expect $5–15/month at starter usage levels.
Krayin CRM vs Salesforce
| Feature | Krayin CRM | Salesforce |
|---|---|---|
| License | MIT (free) | $75+/user/month |
| Self-hosted | Yes | No (SaaS only) |
| API limits | Unlimited | Tier-based |
| Customization | Full source access | AppExchange + Apex |
| Setup time | Minutes (Docker) | Weeks to months |
| Data sovereignty | Full control | Salesforce servers |
Krayin is ideal for teams that need a capable CRM without the per-seat cost of Salesforce, especially when data sovereignty or customization matters.
FAQ
What is Krayin CRM and why self-host it? Krayin CRM is a free, open-source Laravel-based CRM for managing leads, contacts, sales pipelines, and customer activities. Self-hosting gives you full data ownership, unlimited users at zero licensing cost, and the ability to customize the codebase.
What does this Railway template deploy for Krayin CRM?
This template deploys the webkul/krayin:2.2.0 Docker image with Nginx, PHP-FPM, and Supervisord, connected to a Railway-managed MySQL 8.0 database. Database migrations and seeding run automatically on first deploy.
Why does the Krayin CRM template include a MySQL database? Krayin is built on Laravel with MySQL as the required database backend. The Railway-managed MySQL service provides persistent storage, automatic backups, and private networking so CRM data survives redeployments.
How do I configure email integration in self-hosted Krayin CRM?
Navigate to Settings > Email Configuration in the admin panel. Krayin supports SMTP for outbound email and SendGrid inbound parse webhooks for receiving emails directly in the CRM inbox. Set MAIL_MAILER, MAIL_HOST, MAIL_PORT, and MAIL_USERNAME environment variables for SMTP configuration.
Can I use Krayin CRM's REST API to integrate with external tools? Yes. Krayin provides a full CRUD REST API covering leads, contacts, organizations, activities, and products. API documentation is at devdocs.krayincrm.com/1.x/api/. Outbound webhooks are also available for event-driven integrations.
How do I reset the admin password in self-hosted Krayin CRM?
Log in with the default credentials ([email protected] / admin123), navigate to Settings > Users, click your admin user, and update the password. If you've lost access, connect to the MySQL database directly and update the users table.
Template Content
MySQL
mysql:9.4Krayin
webkul/krayin:2.2.0