---
title: "Deploy phpMyAdmin + MySQL | (Just Updated) Fixes the Apache Crash Loop"
description: "Fixes the Apache MPM crash loop and keeps logins alive across redeploys."
category: "Storage"
url: https://railway.com/deploy/phpmyadmin-mysql-or-just-updated-fixes-t
---

# Deploy phpMyAdmin + MySQL | (Just Updated) Fixes the Apache Crash Loop

Fixes the Apache MPM crash loop and keeps logins alive across redeploys.

**[Deploy phpMyAdmin + MySQL | (Just Updated) Fixes the Apache Crash Loop on Railway](https://railway.com/template/phpmyadmin-mysql-or-just-updated-fixes-t)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/phpmyadmin-mysql-or-just-updated-fixes-t/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Storage

## Template content

### phpmyadmin

- **Image:** ghcr.io/bon5co/phpmyadmin-railway:5.2.3
- **Health check:** /
- **Public domain:** Yes

### mysql

- **Image:** mysql:9.4
- **Start command:** `/bin/sh -c 'MEM=$(cat /sys/fs/cgroup/memory.max 2>/dev/null || echo max); case "$MEM" in ""|max|*[!0-9]*) MEM=2147483648;; esac; BP=$((MEM / 1024 / 1024 * 50 / 100)); [ "$BP" -lt 128 ] && BP=128; echo "[railway] innodb_buffer_pool_size=${BP}M"; exec docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=${BP}M'`

## Documentation

# Deploy and Host phpMyAdmin + MySQL on Railway

A working **phpMyAdmin 5.2.3** web console with its own **MySQL 9.4** database, in one
deploy. The MySQL data directory and the phpMyAdmin session store are both on Railway
volumes, and the admin credentials are generated for you — there is nothing to fill in
on the deploy form.

## About Hosting phpMyAdmin + MySQL

Two services. MySQL 9.4 stores its data on a volume and is published on a Railway TCP
proxy so your own applications can connect to it; its InnoDB buffer pool is sized from
the container's actual memory limit rather than MySQL's fixed 128 MB default.
phpMyAdmin runs from a wrapper image that fixes three things the stock image does not
handle on Railway: it removes the duplicate Apache MPM module that otherwise aborts
Apache at start with `More than one MPM loaded`, it binds Apache to the port Railway
injects, and it pins the phpMyAdmin blowfish secret while keeping PHP's session files
on a volume — so a redeploy no longer signs everyone out mid-task. The phpMyAdmin
configuration storage database and its control user are created automatically on first
boot, which enables bookmarks, query history, column comments and designer layouts.
Both services carry a real healthcheck, so a broken boot is reported as a failed
deploy instead of a green one.

## Why Deploy phpMyAdmin + MySQL on Railway?

Railway gives you a public HTTPS URL for the console, a TCP proxy for the database, and
managed volumes for both — the whole stack a small MySQL project needs, with no VM,
no Apache configuration and no TLS certificates to manage. The root password and the
phpMyAdmin secrets are generated per deploy, so nothing is shared between deploys and
no credential is typed into a form.

## Common Use Cases

- A browser admin console for a MySQL database you already run on Railway.
- A quick managed MySQL instance plus a GUI for prototyping, imports and one-off queries.
- A shared database browser for a small team, reachable by URL with no client install.

## Dependencies for phpMyAdmin + MySQL

- phpMyAdmin 5.2.3 (pinned), running on Apache with PHP 8.3.
- MySQL 9.4 (pinned).

### Deployment Dependencies

- None beyond the two services in this template. MySQL is deployed as part of the
  template; no external database or cache is required.


## Similar templates

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

Open this page in a browser: https://railway.com/deploy/phpmyadmin-mysql-or-just-updated-fixes-t
