
Ghost is an open-source publishing platform designed for bloggers, journalists, and content creators. It provides built-in newsletter functionality, membership management, and subscription features. Recent versions support ActivityPub federation for interaction with decentralized social networks and include web analytics through Tinybird integration.
This article explains how to install Ghost Blogging Platform on Ubuntu 24.04 using two methods: Ghost-CLI for a traditional installation and Docker Compose for containerized deployments with analytics capabilities.
Before you begin, ensure you:
sudo privileges.ghost.example.com.The CLI method installs Ghost directly on the host system using Ghost-CLI. This requires you to install Node.js, MySQL, and Nginx as dependencies before installing Ghost.
Ghost is compatible with Node v22 LTS. You can check the list of compatible Node versions for Ghost at the official documentation.
Download and run the NodeSource setup script to install Node.js v22 LTS.
Verify the installed Node.js version.
Output:
Install the MySQL Server.
MySQL starts automatically and runs as a service.
Verify the MySQL installation.
Your output should be similar to the one below.
Secure the MySQL installation.
Follow the interactive prompts to improve MySQL security. The root account uses the auth_socket plugin by default, which authenticates based on the system user and does not require a separate password.
y to enable password validation for new database users.2 for strong password requirements (uppercase, lowercase, numbers, special characters).y to remove anonymous access.y to restrict root access to localhost only.y to delete the test database.y to apply changes immediately.Log in to the MySQL console.
Create a database, user, and grant privileges.
Install Nginx.
Allow HTTP and HTTPS traffic through the firewall.
Verify Nginx is running.
Install the Ghost-CLI package globally.
Create a directory for the Ghost installation.
Set ownership to the current user.
Set directory permissions.
Navigate to the Ghost directory.
Run the Ghost installation process.
The installer prompts for configuration details. Provide the following information:
https://ghost.example.comlocalhostghostuser)Your_password2!)ghost_db)y to configure Nginx automaticallyy to install acme.sh for SSL certificate managementy to create a systemd service for Ghosty to start Ghost immediatelyTo update any of the parameters, edit the configuration file below..
After changing the configuration, restart Ghost.
Alternatively, restart and view the status of Ghost using systemd. Replace ghost-example-com with your domain name.
From the output, verify that the service is running.
Navigate to the Ghost installation directory.
Create a backup before updating. This command prompts for your sudo password and staff access token. You can find the staff access token under Settings > Staff > View Profile.
Update Ghost to the latest version.
Ghost-CLI handles database migrations and applies all required changes, which may result in brief downtime.
To update to a specific version, replace VERSION with the desired release.
Navigate to the Ghost admin panel at https://ghost.example.com/ghost.
Complete the initial setup form with the following details:
Click Create account & start publishing to complete setup.
After setup, access the admin panel at https://ghost.example.com/ghost to:
You have successfully installed Ghost on Ubuntu 24.04 using either Ghost-CLI for traditional deployments or Docker Compose for containerized environments. Both methods provide a production-ready Ghost installation with SSL certificates, automated backups (CLI method), and optional web analytics through Tinybird integration. Ghost is now ready for content creation, newsletter distribution, and membership management.
0 Comments
Be the first to comment and share your perspective with the community.