Updated: 28 September 2026 · Applies to: ApostropheCMS 4 on Ubuntu 24.04 (Node.js 24)
Ubuntu 18.04 is end of life. ApostropheCMS is a Node.js content management system with in-context editing, backed by MongoDB. The current major version is Apostrophe 4, which needs Node.js 22 or newer. This guide uses Ubuntu 24.04.
Install Node.js (current LTS)
Use the NodeSource packages for the current Long-Term-Support release (24.x at the time of writing; check nodejs.org):
curl -fsSL https://deb.nodesource.com/setup_24.x | bash - # Ubuntu / Debian apt install nodejs curl -fsSL https://rpm.nodesource.com/setup_24.x | bash - # AlmaLinux / Rocky dnf install nodejs
Check with node -v and npm -v.
Tip: For development machines, or several Node versions side by side, use nvm instead: install it from its GitHub page, then nvm install --lts.
Install MongoDB
Follow the MongoDB steps in "How to install MEAN Stack (MongoDB, Express.JS, Angular.JS, Node.JS) on Ubuntu 16.04" (updated for Ubuntu 24.04).
Create a project
npm install -g @apostrophecms/cli apos create mysite # asks for an admin password cd mysite npm run dev # development server on port 3000
Run it in production
NODE_ENV=production npm run build npm install -g pm2 NODE_ENV=production pm2 start app.js --name mysite pm2 save && pm2 startup
Put Nginx in front of port 3000 with HTTPS. Log in at /login with the admin user.