5. Creating Ghost Installation Directory and Setting Permissions
Create the directory to store the Ghost application files and set the ownership to ghost-user.
Note: This step must be performed while logged in as ghost-user.
# Create /var/www/ghost directory
sudo mkdir -p /var/www/ghost
# Grant directory ownership to the current user (ghost-user)
sudo chown ghost-user:ghost-user /var/www/ghost
# Change to the installation directory
cd /var/www/ghost
6. Running Ghost Installation (ghost install)
Execute the core Ghost-CLI command ghost install. This command automatically handles Node.js environment checks, file downloads, database connection, and web server configuration. You will need to respond to interactive prompts during installation. The CLI will detect Nginx and/or Apache if installed, and prompt you accordingly.
6.1. Running the Installation Command
ghost install
6.2. Responding to Interactive Prompts
The following questions will appear during installation. Respond using the information configured in Page 2. Note that the CLI will ask if you want to set up Nginx, or if Apache is installed, it may ask to configure Apache.
? Enter your blog URL: <https://your-domain.com>
? Enter your MySQL hostname: <localhost>
? Enter your MySQL username: <ghost_db_user>
? Enter your MySQL password: <secure_password_for_db_user>
? Enter your Ghost database name: <ghost_database_name>
? Set up Nginx? (Y/n): Y # Automatically configure web server (or Apache if installed, the question might vary)
? Set up SSL? (Y/n): Y # Configure HTTPS using Let's Encrypt
? Enter your email (for SSL config): <your-email@example.com> # Used for certificate issuance
? Set up Systemd? (Y/n): Y # Configure Systemd for automatic service management
? Start Ghost now? (Y/n): Y # Start Ghost immediately after installation
Ghost-CLI will complete all configurations, apply the web server settings, automate SSL certificate issuance, and finally start the Ghost process.