How To Install Ghost on Manjaro
Ghost is a powerful, open-source content management system (CMS) designed for modern publishing. Known for its speed and simplicity, it provides a clean interface that allows bloggers and publishers to focus on their content. Installing Ghost on Manjaro, a popular Arch-based Linux distribution, can enhance your blogging experience significantly. This guide will walk you through the entire installation process step-by-step, ensuring you have everything set up correctly.
Introduction
In this article, we will cover the prerequisites for installing Ghost on Manjaro, downloading the necessary files, configuring the system, and troubleshooting common issues. By the end of this guide, you will have a fully functional Ghost installation running on your Manjaro system.
Prerequisites
Before diving into the installation process, ensure your system meets the following requirements:
- Operating System: Manjaro Linux (latest version recommended)
- Hardware: At least 1GB of RAM and 10GB of storage space
- Node.js: Version 14.x or higher
- NPM: Node package manager
- Database: MySQL or SQLite (for local installations)
To install the required packages, open your terminal and run:
sudo pacman -S nodejs npm git nginx
Downloading Ghost
The first step in installing Ghost is to download the latest version. Follow these steps:
-
- Open your terminal.
- Use the following command to download the latest Ghost release:
wget https://ghost.org/zip/ghost-latest.zip
-
- Once downloaded, extract the files using:
unzip ghost-latest.zip -d ghost
-
- Navigate into the newly created directory:
cd ghost
Installing Ghost CLI
The Ghost Command Line Interface (CLI) simplifies the installation and management of your Ghost instance. To install Ghost CLI globally, run:
npm install -g ghost-cli@latest
After installation, verify that Ghost CLI is working by checking its help command:
ghost help
Configuring Ghost
The next step involves configuring Ghost to run properly on your system. Here’s how to do it:
- Create a configuration file by copying the example configuration:
cp config.example.js config.js
- Edit the configuration file with your preferred text editor:
nano config.js
- Set the URL property in the configuration file to match your desired access point (e.g.,
http://localhost:2368
).
Creating a Dedicated User for Ghost
For security reasons, it’s advisable to run Ghost under a dedicated user account. Create a new user with the following command:
sudo useradd --system --create-home --home-dir /srv/ghostcms --gid http ghostcms
Installing Ghost
You are now ready to install Ghost. Ensure you are in the ghost directory and run:
ghost install
This command will guide you through several prompts where you will need to provide information such as your blog URL and database settings. If you choose to use MySQL, ensure that it is installed and running on your system.
Selecting Database Options
You can opt for SQLite for simpler setups or MySQL for more robust installations. If using MySQL, ensure you have created a database and user for Ghost prior to running the installation command.
Starting Ghost
After successful installation, start your Ghost instance with:
ghost start
You can access your new blog by navigating to http://localhost:2368
in your web browser.
Setting Up NGINX as a Reverse Proxy
If you want to serve your Ghost blog through NGINX (which is recommended), follow these steps:
- If you haven’t installed NGINX yet, do so by running:
sudo pacman -S nginx
- Create a new NGINX configuration file for your site in
/etc/nginx/sites-available/ghost.conf
. - Add the following configuration (adjust server_name as needed):
server {
listen 80;
server_name example.com; # Replace with your domain or IP
location / {
proxy_pass http://localhost:2368;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
- Create a symbolic link to enable this configuration:
sudo ln -s /etc/nginx/sites-available/ghost.conf /etc/nginx/sites-enabled/
- Test NGINX configuration for errors:
sudo nginx -t
- If there are no errors, restart NGINX:
sudo systemctl restart nginx
Troubleshooting Common Issues
Error: ECONNREFUSED when starting Ghost
This error usually indicates that Ghost cannot connect to MySQL or another service it depends on. Ensure that MySQL is running by executing:
sudo service mysql start
Error: Permission Denied Errors
If you encounter permission denied errors during installation or when starting Ghost, check that your user has appropriate permissions on the directories used by Ghost.
Error: Database Connection Issues
If you receive an error regarding database connections during installation or startup, double-check your database credentials in config.js and ensure that MySQL is configured correctly.
Error: Missing Dependencies or Outdated Packages
If any dependencies are missing or outdated during installation, ensure that all required packages are installed and up-to-date by running:
sudo pacman -Syu nodejs npm mysql mariadb-server nginx git unzip zip
Congratulations! You have successfully installed Ghost. Thanks for using this tutorial for installing Ghost Content Management System on Manjaro system. For additional help or useful information, we recommend you check the official Ghost website.