---
title: "Deploy PrestaShop — Self-Hosted Online Store & Shopify Alternative"
description: "Self-host PrestaShop — full online store, no transaction fees"
category: "CMS"
url: https://railway.com/deploy/prestashop-ecommerce-store
---

# Deploy PrestaShop — Self-Hosted Online Store & Shopify Alternative

Self-host PrestaShop — full online store, no transaction fees

**[Deploy PrestaShop — Self-Hosted Online Store & Shopify Alternative on Railway](https://railway.com/template/prestashop-ecommerce-store)**

- **Creator:** SilverBanana
- **Category:** CMS

## Template content

### Prestashop https://cdn.jsdelivr.net/gh/selfhst/icons/svg/prestashop-light.svg

- **Image:** prestashop/prestashop:8-apache
- **Public domain:** Yes

### MySQL https://devicons.railway.app/i/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 PrestaShop on Railway

PrestaShop is a powerful open-source e-commerce platform — a self-hosted alternative to Shopify for running a full online store with products, categories, carts, checkout, payments, shipping, taxes, and a complete back office. Own your store with no monthly platform fee and no per-sale commission. This template deploys PrestaShop with a Railway-managed MySQL database, an auto-installer, and the platform's Railway-specific quirks already solved — so you land on a working store, not a broken install.

---

## What This Template Deploys

| Service | Purpose |
| --- | --- |
| **PrestaShop** | The storefront, checkout, and admin back office (PHP on Apache) |
| **MySQL** | Products, orders, customers, configuration, and CMS pages |

Both connect over Railway's private network. A persistent volume at `/var/www/html` holds product images, installed modules, themes, and cache, while MySQL is the single source of truth for all store data — both surviving redeploys.

---

## About Hosting

PrestaShop is a mature platform, and it has a few Railway-specific sharp edges that break naive deploys — all handled here.

**Set your domain before first deploy — it's baked in at install.** This is the critical one: PrestaShop writes `PS_DOMAIN` into the database during installation, so if it's wrong at first boot, your storefront links, images, and assets point at the wrong host and the site breaks. Set your final Railway (or custom) domain before the first deploy. This template configures it correctly and handles dynamic-domain detection so your store loads right the first time.

**Your admin URL is normalized for you.** For security, PrestaShop's installer renames the `admin/` folder to a random name — which means on a plain deploy you can't find your own admin panel. This template's entrypoint restores it to a known `PS_FOLDER_ADMIN` value, so you always know your admin URL after install, without hunting through the filesystem.

**Railway volume and SSL quirks are handled, and it auto-installs.** With `PS_INSTALL_AUTO=1`, PrestaShop installs automatically against MySQL on first boot (1–2 minutes) and creates your admin from `ADMIN_MAIL`/`ADMIN_PASSWD`. The template also cleans the `lost+found` directory Railway's ext4 volumes create at the mount root, and trusts Railway's `X-Forwarded-Proto` header so PrestaShop detects HTTPS behind the reverse proxy — so secure checkout and mixed-content issues just work.

**Everything persists on the volume.** Product images, installed modules, themes, and cache live on the `/var/www/html` volume, and all store data lives in MySQL — both survive redeploys, so modules and uploads behave like classic hosting. Upgrade PrestaShop through its built-in upgrade module rather than swapping image tags, and back up MySQL, which holds your entire store.

**Add payments and shipping in the back office.** PrestaShop supports all major payment gateways (Stripe, PayPal, and more) and shipping carriers through modules — install them from the Module Manager, including premium ZIPs from the marketplace, which persist across deployments.

Typical cost: **~$10–15/month** on Railway for the store and MySQL, scaling with catalog size and traffic. PrestaShop is OSL-3.0 and free — no license fees and no transaction commissions, unlike Shopify.

---

## How It Compares

| | PrestaShop (self-hosted) | Shopify | WooCommerce | Magento |
| --- | --- | --- | --- | --- |
| Cost model | Flat infra | Monthly + fees | Flat infra | Flat infra (heavy) |
| Transaction fees | None | Per sale (some plans) | None | None |
| Complete out of the box | Yes | Yes | Plugin-assembled | Yes |
| Data ownership | Full — your infra | Vendor | Full | Full |
| Footprint | Moderate | N/A | WordPress-based | Heavy |
| Self-hostable | Yes | No | Yes | Yes |

Shopify is polished but charges monthly and can take a per-sale cut, keeping your store on its platform. WooCommerce is flexible but assembled from WordPress plus plugins. Magento is powerful but heavy to run. PrestaShop's edge is a complete, purpose-built store out of the box — catalog, checkout, and back office — self-hosted at flat cost with no transaction fees and your data on infrastructure you own.

---

## Deploy in Under 5 Minutes

1. Set your final domain first, then click **Deploy on Railway** — PrestaShop and MySQL build (~4 minutes)
2. Confirm `PS_DOMAIN`, `ADMIN_MAIL`, and `ADMIN_PASSWD` are set before first boot
3. Wait for the auto-installer to finish (1–2 minutes)
4. Open your admin URL (the normalized `PS_FOLDER_ADMIN` path) and log in
5. Add products, configure a payment module, and set up shipping — your storefront is live

Install payment and shipping modules from the Module Manager; they persist on the volume.

---

## Common Use Cases

- **Online store** — a complete self-hosted shop with catalog, cart, and checkout, no platform fee
- **Shopify alternative** — run your store without monthly fees or per-sale commissions
- **B2B / wholesale portal** — build a wholesale or marketplace store with PrestaShop modules
- **Data-owned retail** — keep customer, order, and product data on your own infrastructure

---

## Configuration

| Variable | Required | Description |
| --- | --- | --- |
| `PS_DOMAIN` | Required | Your final domain — baked in at install, so set it before first deploy |
| `ADMIN_MAIL` | Required | Admin account email, created by the auto-installer |
| `ADMIN_PASSWD` | Required | Admin password — set a strong value |
| `PS_FOLDER_ADMIN` | Pre-set | The known admin folder path (restored from the installer's random name) |
| `DB_SERVER` / `DB_NAME` / `DB_USER` / `DB_PASSWD` | Auto-injected | MySQL connection via Railway references |
| Storage volume | Pre-set | Persistent volume at `/var/www/html` for images, modules, themes |

> **Set `PS_DOMAIN` before first deploy.** PrestaShop writes the domain into the database at install, so setting it wrong breaks links and assets. This template also normalizes your admin folder and handles Railway's volume and SSL-proxy quirks.

> **Auto-install and persistence.** `PS_INSTALL_AUTO=1` installs on first boot and creates your admin from `ADMIN_MAIL`/`ADMIN_PASSWD`. Store data lives in MySQL and files on the volume — back up MySQL to preserve your store.

---

## Dependencies for PrestaShop Hosting

- Railway account — ~$10–15/month for the store and MySQL, scaling with catalog and traffic
- MySQL (included and wired via Railway references)
- A persistent volume at `/var/www/html` for images, modules, and themes (included)
- A payment gateway account (Stripe, PayPal, etc.) configured via modules

### Deployment Dependencies

- [PrestaShop GitHub Repository](https://github.com/PrestaShop/PrestaShop)
- [PrestaShop Documentation](https://devdocs.prestashop-project.org/)
- [PrestaShop Docker Guide](https://github.com/PrestaShop/docker)
- [Railway Volumes Documentation](https://docs.railway.com/volumes)

### Implementation Details

The template runs the official `prestashop/prestashop` image (PHP on Apache) with a Railway-managed MySQL database over the private network, using a Railway-aware entrypoint to solve three platform-specific issues. First, `PS_DOMAIN` is written into the database at install time, so the domain must be set correctly before the first deploy or storefront links and assets break. Second, PrestaShop's installer renames the `admin/` directory to a random name for security, which the entrypoint normalizes back to the configured `PS_FOLDER_ADMIN` so the admin URL is predictable. Third, it cleans the `lost+found` directory Railway's ext4 volumes place at the mount root and trusts `X-Forwarded-Proto` for correct HTTPS detection behind Railway's reverse proxy.

With `PS_INSTALL_AUTO=1`, the installer runs automatically on first boot against MySQL and removes itself, creating the admin from `ADMIN_MAIL` and `ADMIN_PASSWD`. Product images, modules, themes, and cache persist on the volume at `/var/www/html`, while all store data persists in MySQL, the single source of truth and primary backup target. Modules (including premium marketplace ZIPs) install through the back office and persist; upgrades go through PrestaShop's upgrade module rather than image tags.

---

## Frequently Asked Questions

**Why did my store break after deploy?** Almost always `PS_DOMAIN` — PrestaShop bakes the domain into the database at install, so a wrong value breaks links and assets. Set your final domain before first deploy; this template handles it and dynamic-domain detection.

**Where is my admin panel?** At the normalized `PS_FOLDER_ADMIN` path. PrestaShop's installer randomizes the admin folder name for security, and this template restores it to a known value so you can always find your admin URL.

**How do I add payments?** PrestaShop supports all major gateways (Stripe, PayPal, and more) via modules — install them from the Module Manager in the back office. Premium module ZIPs from the marketplace work too and persist on the volume.

**Is HTTPS handled?** Yes — the template trusts Railway's `X-Forwarded-Proto` header so PrestaShop detects HTTPS behind the reverse proxy, so secure checkout works without mixed-content issues.

---

## Why Deploy PrestaShop 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 PrestaShop on Railway you get a complete online store with the hard parts solved — MySQL wired, the auto-installer run, the domain and admin folder handled, and Railway's volume and SSL quirks smoothed over. Sell products worldwide with no transaction fees, self-hosted on infrastructure you own.

## Similar templates

- [Libredesk - Complete Setup](https://railway.com/deploy/libredesk-complete-setup) — [Jul'26] Complete self-hosted omnichannel customer support desk.
- [Paperless-ngx](https://railway.com/deploy/paperless-ngx-3) — Document management with OCR on Railway with PostgreSQL and Redis
- [Instatic CMS - Postgres](https://railway.com/deploy/instatic-cms-postgres) — Design, build and manage powerful static sites from state-of-the-art CMS

Open this page in a browser: https://railway.com/deploy/prestashop-ecommerce-store
