Before you learn how to install CMS on Ubuntu, you need to know what Mezzanine is about.
Mezzanine is a Content Management System scripted in Python using the Django framework. It was developed by Stephen McDonald in 2010, and publicly released in 2012. It is free and open-source platform providing an intuitive interface for managing pages, blog posts, form data, store products, and many other features of content. All these features are available by default without adding special functionally or additional modules.
Through this top publishing tool, developers and online publishing enthusiasts can build websites and publish contents of various types online.
If you are a developer accustomed of developing apps in Django, using Mezzanine is going to be a seamless experience for you. Furthermore, there are many ways in which you can install Mezzanine on Ubuntu, but the quickest and fastest way is using Python and PIP. This tutorial will guide you on how to install Mezzanine on Ubuntu. Mezzanine is packed with popular features like, hierarchal page navigation, drag and drop page ordering, scheduled publishing, WYSIWYG editing, in-line page editing, drag and drop HTML5 forms builder with CSV export, adding e-commerce or shopping car module, blog engine, tagging, translated to over 35 languages, multi-lingual sites, and one-step migration from other blogging engines.
What is Django?
It is a Python programming language based on a web-development framework. It consists of multiple libraries and is packed with tons of tools and features for developers looking to start an online blog quickly.
It helps developers in creating custom applications or APIs but it is also packed software, solving a specific set of problems. There are many softwares built using DJango, one of them is Mezzanine CMS.
Prerequisites required to install Mezzanine on Ubuntu
The following are the requirements for installing Mezzanine on Ubuntu.
- Ubuntu 18.04 VPS
- Sudo user privileges or full SSH root access
How to install Mezzanine on Ubuntu
The following steps will educate you on how to install Mezzanine on Ubuntu. These include:
Step #1: Connect to your server
You need to connect your server through SSH as the root user or as any other user having sudo
privileges. Execute command:
ssh [email protected]_ADDRESS -p PORT_NUMBER
Now that you’re logged in, update your server to the latest versions. Use commands,
sudo apt update
sudo apt upgrade
Step #2: Install Python 3 and PIP
The easiest way to install Mezzanine is through Python pip. PIP is package management system used to install and manage packages written in Python.
Install Python 3 and pip3 on your server using command,
sudo apt install python3 python3-pip python3-dev
Verify it by running command,
python3 -v
The output should include the latest version of Python as:
Python 3.6.7
Verify pip3 installation using command,
pip3 -v
The output should include,
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
Step #3: Install MySQL and create a Mezzanine database
Install the MySQL database server using the command:
sudo apt install mysql-server
The MySQL web server will start automatically post the completion of installation Check its running using the command:
sudo systemctl status mysql
Enable automatic running of MySQL service upon reboot by executing command:
sudo systemctl enable mysql
Secure the MySQL with a password for the MySQL root user. Run the following code and follow all the on-screen instructions. Read the steps that will set the root password, remove any anonymous users, disallow remote root login, and remove the test databases and access to secure MariaDB.
sudo mysql_secure_installation
Log in as root user in the MySQL database server. Use command:
sudo mysql -u root -p
Create a new database and user, by running the following commands:
CREATE DATABASE mezzanine CHARACTER SET UTF8; CREATE USER [email protected] IDENTIFIED BY 'strong-password'; GRANT ALL PRIVILEGES ON mezzanine.* TO [email protected]; FLUSH PRIVILEGES;
Ext, the MySQL shell, using:
exit;
Step #4: Install Python virtual environment for Mezzanine
Install the Python Virtual Environment using the command:
sudo pip3 install virtualenv
Step #5: Create a Mezzanine user
Now, create a new user for installing Mezzanine CMS. Execute command,
adduser mezzanine
usermod -aG sudo mezzanine
Step #6: Create a new Virtual Environment
To create a new virtual environment for Mezzanine CMS, run the following command:
virtualenv mezzanine
The output will be shown as:
Using base prefix '/usr' New python executable in /home/mezzanine/mezzanine/bin/python3 Also creating executable in /home/mezzanine/mezzanine/bin/python Installing setuptools, pip, wheel… done.
Activate the virtual environment by running the following command:
source mezzanine/bin/activate
Step #7: Install the Mezzanine CMS on CentOS
To install the Mezzanine CMS on the new virtual environment, run the following command:
pip install mezzanine
Step #8: Create a new Mezzanine App/Project
To create a new Mezzanine project, run the following command:
mezzanine-project mezzanine_project
This command will add a new directory to your mezzanine_project
. You can name the project as you want. But, you’ll have to use the name for the rest of the tutorial.
Enter the directory by running command:
cd mezzanine_project
Step #9: Configure the Mezzanine application
Now, you need to define the database server for the application. For that, you’ll have to edit the settings in the setting.py file within the main project directory.
nano mezzanine_project/settings.py
Add the following information in the Databases block of the code:
DATABASES = { "default": { "ENGINE": "django.db.backends.mysql", "NAME": "mezzanine", "USER": "mezzanine", "PASSWORD": "strong-password", "HOST": "localhost", "PORT": "", } }
Save all the changes you’ve made and exit it. migrate the database using the following commands.
python manage.py makemigrations python manage.py migrate
Once you’ve migrated, create a new administrative user using the command line:
python manage.py createsuperuser
Now, open the file and edit it by running:
nano mezzanine_project/local_settings.py
Find the Allowed hosts block in the code and then add the IP address of your server and your domain name as well.
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "::1", "you"]
Step #10: Restart the Mezzanine server
To restart the Mezzanine server, run the following command:
python manage.py runserver 0.0.0.0:8000
Now, you can access the application on your browser.
http://your_server_ip:8000/
You’ll be redirected to the default Mezzanine landing page.

Access the admin page and log in with your username and password. The URL is:
https://your_server_ip:8000/admin

Once you add your details, you can view your dashboard.

Conclusion
You’ve successfully installed Mezzanine CMS on Ubuntu using these steps.