Self-host MediaCMS on a managed VPS: your own video portal

To self-host MediaCMS on a managed VPS is to publish your videos, audio, images and PDFs on a portal of your own, on a server that our teams keep up to date and monitor day and night. MediaCMS is a free, open source video and media CMS under the AGPL-3.0 license, used by universities, organizations and communities. This guide follows its official Docker Compose setup at version 9.6.1, and we ran every command on a Simafri VPS before writing it: installation with PostgreSQL, Redis and Celery, HTTPS, portal settings, video encoding, backups and updates.

Simon Vasconcelos Lee By Published on 1 December 202614 minute read

All guides Media, publishing and feeds

In short

  1. The AGPL-3.0 license lets you run MediaCMS for your organization, your school or your community with no license to buy.
  2. Install it the official way: a Git checkout of the release in /opt/mediacms and its docker-compose.yaml, with a docker-compose.override.yaml of your own for the port, the passwords and the database volume.
  3. Publish the port on 127.0.0.1 only, put Caddy in front for HTTPS, and set FRONTEND_HOST to your https:// address.
  4. Add CELERYD_CONCURRENCY to deploy/docker/local_settings.py, set to your number of vCPUs: on our 4 GB test VPS, the 1080p encoding ran out of memory without it, and succeeded with it.
  5. Close self-registration unless you want an open portal, back up with pg_dump and an archive of media_files, and update the Git checkout and the image together.

What MediaCMS does

MediaCMS is a video and media portal written in Python with Django, with a React interface and a REST API. You upload a file, and its Celery workers encode it in several resolutions, build an HLS stream for adaptive playback and produce the thumbnails and preview images.

What the AGPL-3.0 license allows

MediaCMS is published under the GNU Affero General Public License, version 3, copyright Markos Gogoulos. You can use it free of charge, for your organization or your clients, copy it and modify it. If you modify it and let people use it over a network, as a public portal does, you offer them the source code of your modified version under the same license. The software is provided without warranty.

The team behind MediaCMS also offers custom installations, development, migrations, training and support, on its services page.

The resources to plan for

The README counts 4 GB of memory and 2 to 4 CPUs as a minimum for a small to medium portal, with a few hours of video uploaded each day and a few hundred daily viewers. Our test VPS had exactly that, 2 vCPUs and 4 GB, and here is what we measured:

With 2 vCPUs and 4 GB, MediaCMS works, with little headroom during an encoding. For several uploads at a time, longer 1080p videos or transcription, plan more memory and more vCPUs. On a managed VPS, tell us about your usage and we will recommend the right size.

Installing with Docker Compose

The administrators documentation installs MediaCMS from a Git checkout: its docker-compose.yaml mounts the whole folder into the containers, so the code that runs is the code of the checkout, and the mediacms/mediacms image brings Python, ffmpeg and Bento4. On a server with Docker Engine and its Compose plugin, installed from Docker’s repository for Ubuntu, and Git, clone the repository into /opt/mediacms and check out the release:

Terminal
git clone https://github.com/mediacms-io/mediacms /opt/mediacms
Terminal, in /opt/mediacms
git checkout v9.6.1

The official file publishes port 80 on every address of the server, uses mediacms as the database password and keeps the database in ../postgres_data, outside the folder. Rather than edit it, put your changes in a docker-compose.override.yaml next to it, which Docker Compose reads and merges on its own:

docker-compose.override.yaml
# Changes to the official docker-compose.yaml, which Docker Compose merges on its own
x-env: &env
  FRONTEND_HOST: https://mediacms.example.com
  POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}

services:
  migrations:
    environment:
      <<: *env
      ADMIN_EMAIL: admin@mediacms.example.com
      ADMIN_PASSWORD: ${ADMIN_PASSWORD:?set ADMIN_PASSWORD in .env}
  web:
    restart: unless-stopped
    ports: !override
      - "127.0.0.1:8113:80"
    environment: *env
  celery_beat:
    restart: unless-stopped
    environment: *env
  celery_worker:
    restart: unless-stopped
    environment: *env
  db:
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}
    volumes: !override
      - postgres_data:/var/lib/postgresql/data/

volumes:
  postgres_data:

The two passwords go in a .env file, which Docker Compose also reads. Create it readable by root only, then start the stack:

Terminal, in /opt/mediacms
umask 077
printf 'POSTGRES_PASSWORD=%s\nADMIN_PASSWORD=%s\n' "$(openssl rand -hex 24)" "$(openssl rand -hex 12)" > .env
umask 022
docker compose up -d
docker compose ps -a

The first start applies 75 migrations, loads the encoding profiles and the default categories, creates the administrator and collects the static files; on our test VPS, the migrations container finished less than a minute after docker compose up -d, images included. When it shows “Exited (0)”, check that the portal answers:

Terminal, in /opt/mediacms
curl -s http://127.0.0.1:8113/ | grep -o '<title>[^<]*</title>'

It returns <title>MediaCMS</title>, the name of the portal.

HTTPS: the reverse proxy

The web container serves MediaCMS over HTTP, on port 8113 of the server. HTTPS is handled by a reverse proxy in front of it, which must forward X-Forwarded-Proto. We tested Caddy, installed from its official Debian and Ubuntu repository: it obtains the Let’s Encrypt certificate itself, renews it, and forwards that header by default.

/etc/caddy/Caddyfile
mediacms.example.com {
	reverse_proxy 127.0.0.1:8113
}
Terminal
systemctl reload caddy
curl -sI https://mediacms.example.com/

The first login and the portal settings

Open your address and click Sign in. The username is admin, and the password is the one generated in .env, which this command displays:

Terminal
grep ADMIN_PASSWORD /opt/mediacms/.env

Out of the box, anyone can create an account and upload media: USERS_CAN_SELF_REGISTER is on and CAN_ADD_MEDIA is set to all. On a portal open to the internet, decide who may register and upload before you share the address.

The settings of MediaCMS live in cms/settings.py, and the documentation has you override them in deploy/docker/local_settings.py, which the image copies into place at every start. Add these lines at the end of it, then restart the three MediaCMS services:

Terminal, in /opt/mediacms
cat >> deploy/docker/local_settings.py <<'EOF'

# Our settings, after the official ones
USERS_CAN_SELF_REGISTER = False
REGISTER_ALLOWED = False
CAN_ADD_MEDIA = "advancedUser"
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
CELERYD_CONCURRENCY = 2
EOF
docker compose restart web celery_worker celery_beat

We then uploaded our 15-second 1080p test clip. MediaCMS marked it ready as soon as its first resolution was encoded, the other five and the HLS stream followed within 28 seconds, and the 1080p file was served over HTTPS as video/mp4.

Backups

Everything lives in two places: the PostgreSQL database, with the users, the media records and the settings made in the administration, and the /opt/mediacms folder, with media_files (the originals, the encoded versions, HLS and the thumbnails), the .secret_key file that signs sessions, your .env, your override file and your local_settings.py. The PostgreSQL image includes pg_dump:

Terminal, in /opt/mediacms
umask 077
mkdir -p backups
docker compose exec -T db pg_dump -U mediacms -Fc mediacms > backups/mediacms-$(date +%F).dump
tar -czf backups/files-$(date +%F).tar.gz media_files .secret_key .env docker-compose.override.yaml deploy/docker/local_settings.py
umask 022

Under umask 077, both files are readable by root only. The backups folder is inside the folder mounted into the containers, whose start script gives every file to www-data, the user that already holds the database password: schedule this copy and send it off the server. Stored on the disk, the files are also included in the server’s nightly backups.

Restoring

On the same installation, or on a new one with the same checkout, override file and .env where only docker compose up -d db redis has run, stop the application, recreate the database, load the dump and the files, then start it again:

Terminal, in /opt/mediacms
docker compose stop web celery_worker celery_beat &&
docker compose exec -T db dropdb -U mediacms mediacms &&
docker compose exec -T db createdb -U mediacms mediacms &&
docker compose exec -T db pg_restore -U mediacms -d mediacms --exit-on-error --no-owner < backups/mediacms-2026-11-20.dump &&
rm -rf media_files && tar -xzf backups/files-2026-11-20.tar.gz &&
docker compose up -d

Updates

MediaCMS publishes its releases on GitHub, often several a month, and the latest image follows. Since the code comes from your checkout, an update moves the checkout to the new release tag and pulls the image, together. Take a backup first.

Git refuses to work in the folder once the containers have given its files to www-data (“detected dubious ownership”). Allow it once:

Terminal
git config --global --add safe.directory /opt/mediacms

Then fetch the tags, check out the new release, here v9.6.1, and pull the images. --merge carries the lines you added to local_settings.py over to the new version:

Terminal, in /opt/mediacms
git fetch --tags
git checkout --merge v9.6.1
docker compose pull
docker compose up -d
git describe --tags
git diff --stat

Who does what on a managed VPS

Self-hosting means running the server on top of the application. On a managed VPS, our teams take charge of the server and proactively monitor your instance; MediaCMS remains your software, with your media and your settings.

TopicOur teamsYou
The serverSystem and security updates, server interventions includedThe timing that suits you
MonitoringServer monitored 24/7, with intervention without waiting for your callYour media, your users and your settings in MediaCMS
MediaCMSProactive monitoring: errors, slowdowns, memory during encodings, database and disk space spotted, fix recommendedIts installation, updates and settings, which you apply, yourself or through your AI assistant
UsersThe server that carries them, monitored and backed upAccounts, roles and who may upload
BackupsEvery night, encrypted and kept off the machine; restores includedMediaCMS’s own database dumps and media archives, and the restore request, when you need one
MigrationYour current server migrated, free of chargeThe timing of the switch

If you would rather have our teams work inside the application itself, that service is billed by the hour or at a fixed rate, with an estimate shared before the work starts.

MediaCMS, on a server run for you

With a Simafri Managed VPS, our teams keep your MediaCMS instance’s server up to date, monitor it day and night and step in without waiting for your call; they also proactively monitor your instance and recommend useful fixes, which you apply, yourself or through your AI assistant. Backups are encrypted every night and kept off the machine, restores are included, and migrating your current server is free.

Explore Managed VPS

Frequently asked questions

Is MediaCMS free?

Yes. MediaCMS is under the AGPL-3.0 license: you can run it for your organization, your school or your community with no license to buy. If you modify its code and offer it over a network, you share your changes under the same license. What remains is the cost of the server that runs it.

How do I install MediaCMS with Docker Compose?

Clone the repository into /opt/mediacms, check out the release tag, and add a docker-compose.override.yaml that publishes the port on 127.0.0.1, sets FRONTEND_HOST to your https address, takes the database and admin passwords from a .env file and keeps PostgreSQL in a named volume. Run docker compose up -d, then put an HTTPS reverse proxy in front.

What are the hardware requirements of MediaCMS?

The README counts 4 GB of memory and 2 to 4 CPUs as a minimum for a small to medium portal, and three times the size of your uploads in disk space. On our test VPS with 2 vCPUs and 4 GB, MediaCMS used about 2.4 GB at rest and 3.3 GB at the peak of a 1080p encoding, with CELERYD_CONCURRENCY set to 2.

Why does MediaCMS fail to encode 1080p videos?

Often for lack of memory. Celery sizes its encoding pool from the number of processors Python counts, which can be the processors of the host rather than those of your VPS. On our 4 GB test VPS, the 1080p encoding was killed until we added CELERYD_CONCURRENCY = 2 to deploy/docker/local_settings.py and restarted the containers.

What is the default MediaCMS login in Docker?

The first start creates the user admin. Without ADMIN_PASSWORD, its password is random and shown in the log of the migrations container; with ADMIN_PASSWORD in your .env, it is the one you set.

How do I stop people from registering on MediaCMS?

Add USERS_CAN_SELF_REGISTER = False and REGISTER_ALLOWED = False to deploy/docker/local_settings.py, and CAN_ADD_MEDIA = "advancedUser" to choose who uploads, then restart web, celery_worker and celery_beat. The sign-up page then shows Sign Up Closed.

How do I back up MediaCMS in Docker?

Dump the database with pg_dump from the db container, and archive media_files, .secret_key, .env, your override file and local_settings.py from /opt/mediacms, under umask 077. Restore the dump with pg_restore --exit-on-error into a recreated database, the application stopped, then extract the archive.

How do I update MediaCMS in Docker?

Take a backup, then in /opt/mediacms run git fetch --tags, git checkout --merge with the new release tag, docker compose pull and docker compose up -d. The code comes from the checkout, so the checkout and the image move together; the migrations run on their own at start.

Does a managed VPS cover MediaCMS?

A managed VPS covers the server: system, security, monitoring and backups. Our teams also proactively monitor your instance and recommend useful fixes, which you apply. Work inside the application is billed by the hour or at a fixed rate.

Contact us