Railway

Deploy Bagisto | Open Source E-Commerce, Shopify alternative

Self host Bagisto, the Laravel/Vue.js e-commerce platform, on Railway

Deploy Bagisto | Open Source E-Commerce, Shopify alternative

Just deployed

/var/lib/mysql

Just deployed

/var/www/bagisto/storage

Bagisto logo

Deploy and Host Bagisto on Railway

Bagisto is a free, open-source Laravel + Vue.js e-commerce platform for building self-hosted online stores, marketplaces, and headless commerce APIs. Self-host Bagisto on Railway to run a fully featured store — products, carts, orders, customers, multi-channel, multi-currency, multi-vendor — without the recurring per-transaction fees that hosted platforms like Shopify charge.

This Railway template deploys the official webkul/bagisto:2.4.3 Docker image preconfigured with Nginx, PHP-FPM, and Supervisor, wired to a Railway-managed MySQL service. A persistent volume is attached for media uploads, sessions, and Laravel cache, and the start command runs database migrations and seeders idempotently on every boot so the store is ready immediately after deploy.

Bagisto Railway architecture

Getting Started with Bagisto on Railway

After the deploy turns green, click the public URL to load the storefront — you should see the Bagisto demo store with sample categories. Navigate to /admin/login and sign in with the seeded credentials [email protected] / admin123. The first thing to do is change this password from Settings → Users → Admin Users — these defaults are hardcoded in the seeder and the template is publicly reachable. From there, head to Catalog → Products to add your first product, Customers → Groups to define pricing tiers, and Configure → Channels to set your store's default currency and locale.

Bagisto admin dashboard screenshot

Bagisto admin dashboard screenshot

About Hosting Bagisto

Bagisto is a Laravel-based e-commerce framework that ships a complete storefront and admin panel out of the box. It is used by developers who want full control over their store's code and data — payment integrations, custom checkout flows, headless storefront via GraphQL, multi-vendor marketplace modules, and unlimited products with no per-transaction cut.

Key features:

  • Multi-channel, multi-currency, multi-locale store management
  • Built-in catalog manager with attributes, families, configurable products, bundles
  • Order, invoice, shipment, and refund workflows
  • Customer groups, cart rules, catalog rules, coupon codes
  • Headless commerce via GraphQL API
  • Multi-vendor marketplace, B2B, POS, and SaaS modules available as paid add-ons
  • Theme customization with Vue.js + Tailwind frontend

The Railway deployment runs Bagisto in a single container (Nginx + PHP-FPM under Supervisor) and uses a separate Railway-managed MySQL service for data persistence.

Why Deploy Bagisto on Railway

Railway makes self-hosting Bagisto painless:

  • One-click deploy with MySQL, volume, and HTTPS preconfigured
  • Public domain with TLS termination at the edge — no certbot, no reverse proxy
  • Auto-restart, built-in logs, metrics, and rollback
  • Pay only for the compute and storage you use
  • Scale to multiple replicas or upgrade resources from the dashboard

Common Use Cases for Self-Hosted Bagisto

  • Launch a branded direct-to-consumer (DTC) online store with full control over the codebase
  • Run a multi-vendor marketplace where third-party sellers list and fulfill products
  • Power a headless commerce frontend (Next.js, Nuxt) using Bagisto's GraphQL API
  • Build a B2B portal with customer-group pricing, quote workflows, and tax-exempt accounts

Dependencies for Bagisto

  • bagistowebkul/bagisto:2.4.3 (Nginx + PHP 8.3 FPM + Supervisor in one image)
  • MySQL — Railway-managed MySQL 8.x

Bagisto Environment Variables Reference

VariablePurpose
APP_KEYLaravel encryption key — must be static across deploys
APP_URLPublic-facing URL — must be https://${{RAILWAY_PUBLIC_DOMAIN}}
DB_HOST / DB_PORT / DB_DATABASE / DB_USERNAME / DB_PASSWORDMySQL connection — wired to the MySQL service
MYSQL_AUTOSTARTSet to false to disable the image's bundled MySQL
TRUSTED_PROXIES* so Laravel detects HTTPS behind Railway's proxy
RAILWAY_RUN_UID0 — required because the image runs Supervisor
APP_LOCALE / APP_CURRENCY / APP_TIMEZONEDefault locale, currency, and timezone
MAIL_*SMTP credentials for transactional emails

Deployment Dependencies

Hardware Requirements for Self-Hosting Bagisto

ResourceMinimumRecommended
CPU1 vCPU2 vCPU
RAM1 GB2 GB
Storage2 GB volume10 GB volume
RuntimePHP 8.3 + MySQL 8.xPHP 8.3 + MySQL 8.x

A small store with a few hundred products and light traffic runs comfortably on the minimum tier. Catalogs over 5k SKUs, image-heavy stores, or peak traffic events benefit from the recommended tier.

Self-Hosting Bagisto with Docker

The simplest path is to use the Webkul image directly. The following is the docker-compose snippet:

services:
  bagisto:
    image: webkul/bagisto:2.4.3
    ports:
      - "80:80"
    environment:
      APP_URL: https://your-domain.com
      DB_HOST: mysql
      DB_DATABASE: bagisto
      DB_USERNAME: bagisto
      DB_PASSWORD: change-me
      MYSQL_AUTOSTART: "false"
      APP_KEY: base64:GENERATE_WITH_OPENSSL
    volumes:
      - bagisto_storage:/var/www/bagisto/storage
  mysql:
    image: mysql:8.0
    environment:
      MYSQL_DATABASE: bagisto
      MYSQL_USER: bagisto
      MYSQL_PASSWORD: change-me
      MYSQL_ROOT_PASSWORD: change-me
    volumes:
      - mysql_data:/var/lib/mysql
volumes:
  bagisto_storage:
  mysql_data:

Generate a static APP_KEY once and treat it as a secret:

openssl rand -base64 32

Then prefix the output with base64: and store it as APP_KEY.

How Much Does Bagisto Cost to Self-Host?

Bagisto's core platform is fully open-source under the MIT license — the storefront, admin panel, catalog, orders, and checkout cost zero. Webkul sells optional paid modules (multi-vendor marketplace, POS, advanced B2B, SaaS) ranging from one-time licenses of around $200–$1,000. On Railway, you pay only for the compute, MySQL, bandwidth, and volume storage your store actually uses — no per-transaction or per-order fees, no revenue cut.

FAQ

What is Bagisto and why self-host it? Bagisto is a free, open-source Laravel + Vue.js e-commerce platform. Self-hosting on Railway gives you full ownership of the codebase, your customer data, and the storefront — without Shopify-style transaction fees or platform lock-in.

What does this Railway template deploy? Two services: the Bagisto application (Nginx + PHP-FPM under Supervisor in one container) and a Railway-managed MySQL database. A persistent volume is attached at /var/www/bagisto/storage for uploads, logs, and Laravel cache.

Why is MySQL a separate Railway service instead of bundled inside the image? The Webkul image includes MySQL internally, but Railway volumes are 1:1 (one volume per service) and the Bagisto storage directory needs the volume. Externalising MySQL into its own Railway service is more reliable, supports independent backups, and is what Bagisto's own production guidance recommends.

How do I change the default admin password in self-hosted Bagisto? The seeded admin is [email protected] / admin123. After first login at /admin/login, go to Settings → Users → Admin Users, edit the default user, and set a strong password. There is no env var to override these defaults — they are written to the database by the seeder.

Why does my Bagisto store on Railway show unstyled HTML or "Invalid URL" errors? Railway terminates TLS at the edge and forwards plain HTTP to the container. Without fastcgi_param HTTPS on; injected into the Nginx config, Laravel/Vite generate http:// asset URLs that Railway rejects with 503. The template's start command applies this fix automatically; if you run Bagisto behind any other reverse proxy you must replicate it.

Can I run a multi-vendor marketplace on this Bagisto deployment? Yes — the multi-vendor marketplace is a paid Webkul module that installs as a Composer package. Once purchased, follow Webkul's installation steps (require the package, run migrations, publish config) and the existing Railway deployment continues to serve it.

How do I send transactional emails (order confirmations) from self-hosted Bagisto on Railway? Set the MAIL_* env vars on the Bagisto service to point at an SMTP relay (Resend, Postmark, AWS SES, Mailgun, etc.). Bagisto uses Laravel's standard mailer; any provider that exposes an SMTP endpoint works.


Template Content

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

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

Letta
View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

Shahed Nasser