MirrorNest
← Все руководства

Ghost

Ghost is a fast, open-source publishing platform for blogs and newsletters; its officially recommended self-hosted install path is Ghost-CLI on Ubuntu with Node.js, MySQL, and Nginx.

Это руководство составлено на основе официальной документации Ghost, ссылка на которую есть выше — всегда сверяйте точные названия пакетов/версий там перед запуском этих команд на рабочем сервере, так как версии дистрибутива и проекта со временем меняются.
  1. 1Install Node.js

    sudo apt-get update
    sudo apt-get install -y ca-certificates curl gnupg
    sudo mkdir -p /etc/apt/keyrings
    curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
    NODE_MAJOR=22
    echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
    sudo apt-get update
    sudo apt-get install nodejs -y
  2. 2Install Ghost-CLI and MySQL

    sudo npm install ghost-cli@latest -g
    sudo apt-get install mysql-server -y

    Ghost's docs warn against using a system user named 'ghost' — it conflicts with Ghost-CLI's own conventions.

  3. 3Secure MySQL

    sudo mysql
    ALTER USER 'root'@'localhost' IDENTIFIED WITH 'caching_sha2_password' BY 'your-new-root-password';
    FLUSH PRIVILEGES;
    exit
  4. 4Create the site directory

    sudo mkdir -p /var/www/sitename
    sudo chown user:user /var/www/sitename
    sudo chmod 775 /var/www/sitename
    cd /var/www/sitename
  5. 5Install Ghost

    ghost-cli installs Ghost, creates the MySQL user/database, configures Nginx as a reverse proxy, and can request a free Let's Encrypt certificate for you interactively.

    ghost install
  6. 6Create your owner account

    Visit https://<your-domain>/ghost to create your account as the site owner and start publishing.