Railway

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

Just deployed

/var/www/html

Just deployed

/var/lib/mysql

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

ServicePurpose
PrestaShopThe storefront, checkout, and admin back office (PHP on Apache)
MySQLProducts, 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)ShopifyWooCommerceMagento
Cost modelFlat infraMonthly + feesFlat infraFlat infra (heavy)
Transaction feesNonePer sale (some plans)NoneNone
Complete out of the boxYesYesPlugin-assembledYes
Data ownershipFull — your infraVendorFullFull
FootprintModerateN/AWordPress-basedHeavy
Self-hostableYesNoYesYes

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

VariableRequiredDescription
PS_DOMAINRequiredYour final domain — baked in at install, so set it before first deploy
ADMIN_MAILRequiredAdmin account email, created by the auto-installer
ADMIN_PASSWDRequiredAdmin password — set a strong value
PS_FOLDER_ADMINPre-setThe known admin folder path (restored from the installer's random name)
DB_SERVER / DB_NAME / DB_USER / DB_PASSWDAuto-injectedMySQL connection via Railway references
Storage volumePre-setPersistent 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

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.


Template Content

More templates in this category

View Template
Libredesk - Complete Setup
[Jul'26] Complete self-hosted omnichannel customer support desk.

codestorm
1
View Template
Paperless-ngx
Document management with OCR on Railway with PostgreSQL and Redis

INAPP
1
View Template
Instatic CMS - Postgres
Design, build and manage powerful static sites from state-of-the-art CMS

Instatic
136