How to Deploy ApostropheCMS on Ubuntu 18.04 for Production
ApostropheCMS is a contemporary content management platform powered by NodeJS, designed with an emphasis on flexible and intuitive in-context editing features. This guide explains how to set up ApostropheCMS for a production environment using a clean installation of Ubuntu 18.04.
Prerequisites
- New instance running Ubuntu 18.04, with at least two CPU cores and 1 GB of memory
- A non-root account that has sudo rights
- NodeJS version 10.x or newer
- MongoDB version 4.x or newer
- ImageMagick software installed
Check the Installed Ubuntu Version
lsb_release -ds
# Ubuntu 18.04 LTS
Create a Non-Root User with Sudo Access
adduser johndoe --gecos "John Doe"
usermod -aG sudo johndoe
su - johndoe
Note: Substitute johndoe
with your actual username.
Configure the Time Zone
sudo dpkg-reconfigure tzdata
Update the System
sudo apt update && sudo apt upgrade -y
Step 1: Install NodeJS and NPM
Execute these commands to install NodeJS:
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install -y nodejs
Verify NodeJS and NPM Versions
node -v && npm -v
# v10.x.x
# 6.x.x
Install Build Tools for NPM Packages
Some NPM modules require build tools. Install them using the command below:
sudo apt-get install -y build-essential
Step 2: Set Up MongoDB on Ubuntu 18.04
Begin by adding the official MongoDB GPG key to your machine:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
After successfully importing the key, generate the MongoDB repository source list:
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
Update your package index to include the new MongoDB source:
sudo apt-get update
Proceed with the installation of the MongoDB packages:
sudo apt install -y mongodb-org
To activate the MongoDB service, use the following command:
sudo service mongod start
Step 3: Install ImageMagick on Ubuntu
Install the ImageMagick utility by running:
sudo apt install -y imagemagick
Check that ImageMagick is correctly installed by verifying the version:
convert --version
# Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114 http://www.imagemagick.org
# Copyright: © 1999-2017 ImageMagick Studio LLC
# License: http://www.imagemagick.org/script/license.php
# Features: Cipher DPC Modules OpenMP
# Delegates (built-in): bzlib djvu fftw fontconfig freetype jbig jng jpeg lcms lqr ltdl lzma openexr pangocairo png tiff wmf x xml zlib
Conclusion
By completing the steps in this guide, your Ubuntu 18.04 server is now ready for a reliable and efficient deployment of ApostropheCMS in a production environment. You’ve successfully installed and configured essential components, including NodeJS, MongoDB, and ImageMagick — all of which are crucial for the performance and functionality of ApostropheCMS.
This setup ensures that your content management system will run smoothly with modern development tools and a stable server foundation. ApostropheCMS offers flexible, in-context editing that enhances the user experience, and with this production-ready setup, you can now focus on building and managing your website content confidently.
As a next step, you can proceed with installing ApostropheCMS itself, set up custom modules, apply security hardening, and connect your CMS to your preferred front-end stack. Whether you’re launching a corporate site, a blog, or a complex content platform, this environment provides the scalability and structure needed for a professional web application.