Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk10 min

How to Install the Mezzanine Django CMS on an Ubuntu VPS

Deploy Mezzanine Django CMS on Ubuntu with a compatible Python stack, PostgreSQL, Gunicorn, systemd, Nginx, HTTPS and a practical update and recovery workflow.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To install Mezzanine on Ubuntu and run it as a public site, use a pinned Python/Django/Mezzanine combination, a non-root deployment account, a virtual environment, PostgreSQL, Gunicorn, systemd and Nginx. Mezzanine’s runserver command is suitable only for an initial check; production traffic should reach Gunicorn through Nginx, with static files served separately and HTTPS enabled.

Choose a compatible Mezzanine, Python and Django combination

Mezzanine’s supported dependencies changed between documentation generations. Installing whatever interpreter the Ubuntu image labels python3 can therefore produce an incompatible project. Pin all three components before you create the server.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Documentation or release line Python range stated Django range stated Deployment implication
Mezzanine 4.3.1 overview 2.7–3.6 1.8–1.11 Use only with an interpreter and operating-system packages that can provide those legacy versions.
Repository overview text 3.7–3.10 2.2–4.0 Select a release and Python interpreter inside these ranges, then freeze the environment.

The table describes declared compatibility, not a guarantee that every Ubuntu release still packages the required interpreter. Record the exact Ubuntu LTS image, Mezzanine release, Django version and Python executable you will support. If a required legacy Python is unavailable from the standard repositories, use an approved, maintained method for providing that interpreter rather than silently substituting a newer one.

Prepare the Ubuntu VPS

Create a deployment account

Log in through SSH with the provider’s initial administrator, then create a normal account for the application. Keep the project outside /root; /srv/mezzanine is a clear service location.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
sudo adduser mezzanine
sudo usermod -aG sudo mezzanine
sudo mkdir -p /srv/mezzanine
sudo chown -R mezzanine:mezzanine /srv/mezzanine
su - mezzanine

Use the smallest administrative access the account needs. After confirming key-based SSH access for the new account, disable password authentication and direct root login according to your VPS provider’s recovery procedure. Keep an emergency console or documented recovery path before changing SSH policy.

Update packages and restrict the firewall

sudo apt update
sudo apt upgrade
sudo apt install ufw
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
sudo ufw status

Do not expose PostgreSQL’s port to the public internet for a local database. Permit it only from explicitly trusted networks when a remote connection is genuinely required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install system prerequisites

Install the interpreter that matches your selected Mezzanine release, virtual-environment tooling, build headers, Git, PostgreSQL and Nginx. Pillow and the PostgreSQL adapter may need compiler, image-library and PostgreSQL development headers.

sudo apt install python3 python3-venv python3-dev build-essential 
  libpq-dev libjpeg-dev zlib1g-dev git postgresql nginx

The package names above are representative for an Ubuntu release that provides the required Python. For a versioned interpreter, use that release’s corresponding pythonX.Y, pythonX.Y-venv and development packages. Confirm the result before continuing:

python3 --version
psql --version
nginx -v

If the displayed Python falls outside the compatibility range you recorded, stop and install the pinned interpreter instead of proceeding.

Create the project directory and virtual environment

sudo -u mezzanine mkdir -p /srv/mezzanine
sudo -u mezzanine python3 -m venv /srv/mezzanine/.venv
sudo -u mezzanine /srv/mezzanine/.venv/bin/python -m pip install --upgrade pip
sudo -u mezzanine /srv/mezzanine/.venv/bin/python -m pip install "mezzanine==<version>"

Replace <version> with the release selected in your compatibility record. The angle-bracket value is a command variable, not a version to paste literally. Activate the environment when working interactively:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
cd /srv/mezzanine
. .venv/bin/activate
python --version
python -m pip show mezzanine

Freeze the complete environment after the installation succeeds. This captures Mezzanine and its transitive dependencies for repeatable deployments.

python -m pip freeze > requirements.txt

Keep requirements.txt in version control, but keep database passwords and the Django secret key out of it and out of the repository.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

Scaffold a Mezzanine project

Mezzanine supplies a project generator named mezzanine-project. Run it from the directory that will contain your application:

cd /srv/mezzanine
. .venv/bin/activate
mezzanine-project site
cd site

This creates a Django project whose WSGI module is normally site.wsgi. Confirm the generated tree and keep the project directory owned by the deployment account. If you choose a different project name, substitute that name consistently in the Gunicorn and systemd commands later.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Initialize the database, then switch to PostgreSQL

Understand the quick-start database command

For a disposable evaluation, Mezzanine documents:

python manage.py createdb --noinput

The shortcut applies migrations and can load demo content. Add --nodata when you want a clean database without that sample data. Create an administrator explicitly after initialization:

python manage.py createsuperuser

That quick-start path commonly uses SQLite. SQLite is convenient for a smoke test, but a public installation should use a production database and a backup plan.

Create a PostgreSQL role and database

Django’s production guidance recommends PostgreSQL, and Mezzanine’s deployment stack identifies PostgreSQL as its database server. On the VPS, create a dedicated role and database rather than using the PostgreSQL superuser:

sudo -u postgres psql
CREATE ROLE mezzanine_app LOGIN PASSWORD 'replace-with-a-long-random-secret';
CREATE DATABASE mezzanine_db OWNER mezzanine_app;
q

Use a randomly generated password, store it in a root-readable environment file, and never commit it. If your security policy prohibits passwords in shell history, enter the SQL through a protected administrative session or use a password file with appropriate permissions.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Point Django at PostgreSQL

Edit the generated settings module and replace the SQLite DATABASES entry with PostgreSQL connection details. A typical configuration is:

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": os.environ["MEZZANINE_DB_NAME"],
        "USER": os.environ["MEZZANINE_DB_USER"],
        "PASSWORD": os.environ["MEZZANINE_DB_PASSWORD"],
        "HOST": os.environ.get("MEZZANINE_DB_HOST", "127.0.0.1"),
        "PORT": os.environ.get("MEZZANINE_DB_PORT", "5432"),
    }
}

Ensure the settings file imports os. Create an environment file readable only by the deployment account (and by root for service administration), for example:

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
sudo install -o mezzanine -g mezzanine -m 600 /dev/null /etc/mezzanine.env
sudoedit /etc/mezzanine.env
DJANGO_SETTINGS_MODULE=site.settings
MEZZANINE_DB_NAME=mezzanine_db
MEZZANINE_DB_USER=mezzanine_app
MEZZANINE_DB_PASSWORD=replace-with-the-same-random-secret
MEZZANINE_DB_HOST=127.0.0.1
MEZZANINE_DB_PORT=5432

Load those values in your shell for the one-time management commands, or export equivalent variables before running them. Then apply migrations against PostgreSQL:

cd /srv/mezzanine/site
. ../.venv/bin/activate
python manage.py migrate
python manage.py createsuperuser

Configure production settings

Set security and host values

In the settings module, make these production changes:

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Set DEBUG = False.
  • Set ALLOWED_HOSTS to the domain names and, only when needed for diagnostics, the server address. Do not use a wildcard as a shortcut.
  • Replace the generated development SECRET_KEY with a long random value supplied through an environment variable. Keep it stable across restarts and secret across environments.
  • Configure the canonical site URL and any Mezzanine site settings for the domain users will visit.
  • Configure PostgreSQL using the environment variables described above.

Do not put production secrets in source control. Restrict permissions on environment files and review logs so passwords and secret keys are not printed.

Define static and media storage

Set a persistent directory for collected static assets and a separate persistent directory for user uploads. For example:

STATIC_ROOT = "/srv/mezzanine/static"
MEDIA_ROOT = "/srv/mezzanine/media"
MEDIA_URL = "/media/"

Use the project’s existing static URL setting where appropriate, and make sure the directories exist and are writable during collection and upload operations:

mkdir -p /srv/mezzanine/static /srv/mezzanine/media
python manage.py collectstatic --noinput
python manage.py check --deploy

collectstatic gathers application assets into the directory Nginx will serve. Uploaded media is different: it is site data, so keep it on persistent storage and include it in backups.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Run a local smoke test with Gunicorn

From the project directory and virtual environment, start Gunicorn temporarily on localhost:

cd /srv/mezzanine/site
. ../.venv/bin/activate
gunicorn --bind 127.0.0.1:8000 site.wsgi:application

Check the response from another SSH session:

curl -I http://127.0.0.1:8000/

A successful response confirms that Django can import the WSGI module and reach the configured database. Stop the foreground process with Ctrl+C before creating the permanent service. A public server should not expose this development check directly to the internet.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Run Gunicorn under systemd

Systemd keeps the application running, starts it after boot and restarts it after a failure. Create /etc/systemd/system/mezzanine.service:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
[Unit]
Description=Mezzanine Django application
After=network.target postgresql.service

[Service]
User=mezzanine
Group=mezzanine
WorkingDirectory=/srv/mezzanine/site
EnvironmentFile=/etc/mezzanine.env
ExecStart=/srv/mezzanine/.venv/bin/gunicorn 
  --workers 3 
  --bind unix:/run/mezzanine.sock 
  site.wsgi:application
RuntimeDirectory=mezzanine
Restart=on-failure

[Install]
WantedBy=multi-user.target

The worker count is an operational starting point, not a benchmark result; size it for your VPS and workload. If your Gunicorn binary is not installed, install it inside the same virtual environment:

. /srv/mezzanine/.venv/bin/activate
python -m pip install gunicorn
python -m pip freeze > /srv/mezzanine/requirements.txt

Enable and inspect the service:

sudo systemctl daemon-reload
sudo systemctl enable --now mezzanine
sudo systemctl status mezzanine
sudo journalctl -u mezzanine -e

If systemd reports an import or settings error, verify WorkingDirectory, the WSGI module name, the virtual-environment path and every variable in /etc/mezzanine.env. A Unix socket failure usually indicates a path, runtime-directory or permission mismatch.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Put Nginx in front of Gunicorn

Nginx is the public-facing server; Gunicorn remains an internal application server. This arrangement lets Nginx handle TLS, static files and connection buffering while forwarding dynamic requests to the Unix socket.

Create the server block

Create /etc/nginx/sites-available/mezzanine, replacing example.com with every hostname in ALLOWED_HOSTS:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
server {
    listen 80;
    server_name example.com www.example.com;

    location /static/ {
        alias /srv/mezzanine/static/;
    }

    location /media/ {
        alias /srv/mezzanine/media/;
    }

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://unix:/run/mezzanine.sock;
    }
}

The trailing slashes on the alias paths matter. Ensure Nginx can traverse the directories without granting write access to the web server. Keep media uploads separate from static assets so a deployment cannot accidentally delete user content.

Enable and test Nginx

sudo ln -s /etc/nginx/sites-available/mezzanine /etc/nginx/sites-enabled/mezzanine
sudo rm -f /etc/nginx/sites-enabled/default
sudo nginx -t
sudo systemctl reload nginx

Visit the domain or test it with curl. If Nginx returns 502 Bad Gateway, inspect systemctl status mezzanine, the Gunicorn journal and the socket path. If pages load without CSS or images, verify that collectstatic populated STATIC_ROOT, the Nginx aliases match those directories and file permissions allow reads.

Add HTTPS and secure proxy settings

Obtain a certificate for the production domain from a certificate authority, configure Nginx to listen on 443, and redirect port 80 to HTTPS. Enable automatic renewal and test renewal before relying on it. After TLS is active, configure Django’s secure-cookie and proxy settings consistently with your chosen HTTPS setup, then rerun:

python manage.py check --deploy

Do not claim HTTPS is complete merely because a certificate was issued: test the redirect, certificate renewal, canonical hostname and login/admin pages over HTTPS.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Back up the data and define a repeatable update procedure

Back up PostgreSQL and media

A database dump alone does not preserve uploaded files. Back up PostgreSQL and the entire media directory to storage separate from the VPS, protect the backup credentials, and periodically perform a restore test.

sudo -u postgres pg_dump mezzanine_db > /secure-backup/mezzanine_db.sql
tar -czf /secure-backup/mezzanine-media.tar.gz /srv/mezzanine/media

Adapt the destination, encryption and retention policy to your environment. Document the database role, media path, environment-file location and exact restore order so another administrator can recover the site.

Deploy an application update

  1. Put the new code and reviewed, pinned dependency file in a release or version-control checkout.
  2. Install dependencies with the virtual environment’s interpreter, for example python -m pip install -r requirements.txt.
  3. Run python manage.py migrate against the intended PostgreSQL database.
  4. Run python manage.py collectstatic --noinput.
  5. Run python manage.py check --deploy and exercise the login, editor and public pages.
  6. Restart Gunicorn with sudo systemctl restart mezzanine, then inspect its journal and Nginx error log.
  7. Keep the previous code, requirements and database backup available so you can roll back if the release fails.

Apply schema changes before serving code that requires them, and never test an upgrade first on the only production database.

Common installation failures

Dependency resolution fails during pip install

Check the Python version shown by the virtual environment against the selected Mezzanine and Django ranges. A newer Ubuntu interpreter may be outside the range of an older Mezzanine release. Pin a compatible trio rather than forcing installation with ignored dependency checks.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Database authentication or connection errors

Confirm that PostgreSQL is running, the database and role names match the environment file, the role owns the database, and Django is using 127.0.0.1 and the correct port. Avoid opening PostgreSQL publicly to solve a local configuration error.

Disallowed host or CSRF errors

Match the requested hostname exactly in ALLOWED_HOSTS and the site’s canonical URL settings. When Nginx terminates TLS, pass X-Forwarded-Proto and configure Django’s secure-proxy behavior for that deployment.

Static files are missing

Run collectstatic with the production settings, inspect STATIC_ROOT, check Nginx’s alias spelling and trailing slash, and verify that the Nginx worker can read the resulting files.

Gunicorn starts manually but not through systemd

Systemd does not inherit your interactive shell. Use absolute paths, set WorkingDirectory, load EnvironmentFile, and read journalctl -u mezzanine for the first traceback. Confirm that the service user can read the project, virtual environment and environment file.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What a production-ready Mezzanine VPS should contain

  • A documented Ubuntu image and pinned Python, Django and Mezzanine versions.
  • A non-root deployment user and firewall rules allowing only required SSH and web traffic.
  • A virtual environment with a committed dependency lock or requirements file.
  • PostgreSQL with a dedicated least-privilege role and secrets outside source control.
  • DEBUG = False, correct hosts, a durable secret key and check --deploy results without unresolved warnings.
  • Static files collected into a directory served by Nginx and media stored persistently.
  • Gunicorn supervised by systemd behind Nginx rather than direct public exposure of runserver or Gunicorn.
  • HTTPS with renewal, tested backups for both PostgreSQL and media, and a documented rollback path.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.