---
title: "Deploy MediaCMS | (Just Updated) Self-Hosted YouTube Alternative, Admin Login Pre-Created, Sign-up Closed"
description: "MediaCMS self-hosted video CMS, YouTube alternative with HLS"
category: "CMS"
url: https://railway.com/deploy/mediacms-or-just-updated-self-hosted-you
---

# Deploy MediaCMS | (Just Updated) Self-Hosted YouTube Alternative, Admin Login Pre-Created, Sign-up Closed

MediaCMS self-hosted video CMS, YouTube alternative with HLS

**[Deploy MediaCMS | (Just Updated) Self-Hosted YouTube Alternative, Admin Login Pre-Created, Sign-up Closed on Railway](https://railway.com/template/mediacms-or-just-updated-self-hosted-you)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/mediacms-or-just-updated-self-hosted-you/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** CMS

## Template content

### mediacms

- **Image:** ghcr.io/bon5co/mediacms-railway:9.6.1@sha256:dbe05edf3bbb49076d73955d55896d910afa1eba31152cb095821cfeb44176ef
- **Health check:** /
- **Public domain:** Yes

### database

- **Image:** postgres:17@sha256:b60e90042aa6b8dbecd58e224b3e36114dbf8ad754465264c2476ad58a86e45c

### redis

- **Image:** redis:8.2.1-alpine
- **Start command:** `/bin/sh -c 'chown -R redis:redis /data && exec docker-entrypoint.sh redis-server --requirepass "$REDIS_PASSWORD" --appendonly yes --dir /data'`

## Documentation

# Deploy and Host MediaCMS on Railway

**Built for an LLM agent to deploy and use.** The deploy form has no fields to fill: the admin password, the secret key, the database password and the Redis password are generated, the admin account exists before the site is reachable, and public sign-up is closed. MediaCMS is an open-source video and media CMS with uploads, transcoding to adaptive HLS, playlists, categories, comments and a REST API, a self-hosted alternative to YouTube and Vimeo.

## About Hosting MediaCMS

This template runs three services: **mediacms**, the official MediaCMS image (release v9.6.1) pinned by digest in a thin wrapper, which owns the one public domain on port 8080 with an HTTP healthcheck at `/` and a volume at `/home/mediacms.io/mediacms/media_files` for uploads and encoded renditions; **database**, PostgreSQL 17 with a volume at `/var/lib/postgresql`; and **redis**, Redis 8 (celery broker and cache) with a volume at `/data`.

**What the wrapper fixes.** Stock MediaCMS needs four containers from one image (migrations, web, celery beat, celery worker) sharing volumes, which Railway cannot attach to more than one service, and it leaves public registration open. The wrapper keeps the image's own single-container mode (nginx, gunicorn, celery and migrations under supervisord), points nginx at Railway's injected port, caps celery's process count so it does not size itself from the host's cores, creates the `admin` account with the generated `ADMIN_PASSWORD`, and closes sign-up: the sign-up page says so and a POST to it answers 403. Redeploys keep the admin, the media and the database.

**Using it.** Open your domain and sign in as `admin` with `ADMIN_PASSWORD`. An agent uses the API instead: HTTP basic auth with the user name `admin` and `ADMIN_PASSWORD` against `/api/v1`. E-mail delivery is off. The first start migrates the database and takes about one minute; video encoding is CPU-bound and runs in the same container.

### Agent contract

- Public URL: `https://RAILWAY_PUBLIC_DOMAIN` (the generated domain of the `mediacms` service)
- Private URL: `http://mediacms.railway.internal:8080`
- Credentials: the variable `ADMIN_PASSWORD` on the `mediacms` service (plain text; user name `admin`); `ADMIN_EMAIL` is the admin e-mail address
- Auth: the API takes HTTP basic auth with the user name `admin` and `ADMIN_PASSWORD` (`curl -u "admin:$ADMIN_PASSWORD"`); writes answer 403 without it
- Health: `GET /` returns 200 without credentials

```bash
#!/bin/sh
# needs: RAILWAY_PUBLIC_DOMAIN, ADMIN_PASSWORD (variables of the mediacms service); also curl.
R="https://$RAILWAY_PUBLIC_DOMAIN"; H="content-type: application/json"; J=$(mktemp)
n=0; until [ "$(curl -s -o /dev/null -w '%{http_code}' "$R/")" = 200 ]; do n=$((n+1)); [ "$n" -le 120 ] || break; sleep 5; done
curl -s -o /dev/null -w "health: %{http_code}\n" "$R/"
# sign-up is closed: a stranger who fetches a CSRF token from the login page and POSTs the sign-up form is refused
curl -s -c "$J" -o /dev/null "$R/accounts/login/"
TOKEN=$(awk '$6=="csrftoken"{print $7}' "$J")
curl -s -b "$J" -o /dev/null -w "public signup: %{http_code}\n" -H "Referer: $R/accounts/signup/" --data-urlencode "csrfmiddlewaretoken=$TOKEN" --data-urlencode "username=stranger" --data-urlencode "email=stranger@example.com" --data-urlencode "password1=Not-the-real-one-1" --data-urlencode "password2=Not-the-real-one-1" "$R/accounts/signup/"
# the generated password is the admin account (HTTP basic auth with the user name admin)
curl -s -u "admin:$ADMIN_PASSWORD" "$R/api/v1/whoami" | grep -o '"username":"[^"]*"' | head -1 | sed 's/^/whoami: /'
BODY="{\"title\":\"Agent $$\"}"
# write-auth: POST /api/v1/playlists needs the admin login; without it, or with a wrong password, the answer is 403
curl -s -o /dev/null -w "read with key: %{http_code}\n" -u "admin:$ADMIN_PASSWORD" "$R/api/v1/playlists"
curl -s -o /dev/null -w "write with key: %{http_code}\n" -H "$H" -u "admin:$ADMIN_PASSWORD" -d "$BODY" "$R/api/v1/playlists"
curl -s -o /dev/null -w "write without key: %{http_code}\n" -H "$H" -d "$BODY" "$R/api/v1/playlists"
curl -s -o /dev/null -w "write wrong key: %{http_code}\n" -H "$H" -u "admin:not-a-real-password" -d "$BODY" "$R/api/v1/playlists"
```

Expected output against a fresh deploy:

```text
health: 200
public signup: 403
whoami: "username":"admin"
read with key: 200
write with key: 201
write without key: 403
write wrong key: 403
```

The refusals are the contract: a request without the password is refused (`write without key: 403`), a stranger cannot register (`public signup: 403`) and a wrong password is refused (`write wrong key: 403`).

## Why Deploy MediaCMS 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 MediaCMS on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

- **Agent-ready** - no deployer fields, a contract block, and one script that proves the app is healthy, strangers cannot register, the generated password is the admin and the API refuses writes without it.
- **Admin included** - the admin account has a generated password before the site is reachable, so nobody can claim your site by registering first.
- **One container** - web server, transcoding workers and migrations run together, no shared-volume juggling.
- **Data survives redeploys** - metadata in PostgreSQL on a volume, uploads and encodes on the media volume, the task queue on a Redis volume.
- **Pinned** - MediaCMS, PostgreSQL and Redis are pinned by digest or tag, and the wrapper by tag and digest.

## Common Use Cases

- **Self-hosted video platform** - your own YouTube for a company, school or community, with HLS playback and categories.
- **Internal training and media library** - private or unlisted videos, playlists and comments for a team.
- **Podcast and audio hosting** - upload audio and video, share embeds.
- **Media published by an AI agent** - give an agent the admin login to create playlists and manage media through the API.

## Dependencies for MediaCMS Hosting

- The mediacms service, a PostgreSQL service and a Redis service, each with its volume, created by the template.

### Deployment Dependencies

- [MediaCMS repository](https://github.com/mediacms-io/mediacms)
- [MediaCMS documentation](https://github.com/mediacms-io/mediacms/tree/main/docs)
- [Wrapper image source](https://github.com/bon5co/mediacms-railway)


## Similar templates

- [Libredesk - Complete Setup](https://railway.com/deploy/libredesk-complete-setup) — Complete self-hosted omnichannel customer support desk.
- [Paperless-ngx](https://railway.com/deploy/paperless-ngx-3) — Paperless-ngx — document management with OCR and full-text search
- [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/mediacms-or-just-updated-self-hosted-you
