Ghost è una piattaforma di publishing open source basata su Node.js, focalizzata su scrittura e distribuzione di contenuti. Supporta Markdown, temi, analytics e funzioni membership.
Questa guida distribuisce Ghost dietro Nginx con SSL Let's Encrypt su Ubuntu 20.04.
Prerequisiti
- Server Ubuntu 20.04.
- Dominio puntato al server.
- Accesso root o sudo.
1. Installare le dipendenze
apt-get update -y
apt-get install gnupg2 curl unzip git acl -y
curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
bash nodesource_setup.sh
apt-get install nodejs -y
node -v
npm -v
2. Installare MariaDB e Nginx
apt-get install mariadb-server nginx -y
mysql_secure_installation
Crea database e utente per Ghost:
mysql -u root -p
CREATE DATABASE ghostdb; CREATE USER 'ghostuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL ON ghostdb.* TO 'ghostuser'@'localhost'; FLUSH PRIVILEGES; EXIT;
3. Installare Ghost CLI
npm install -g ghost-cli@1.16.3
ghost version
4. Installare Ghost
Crea un utente dedicato e prepara la directory:
adduser user1
usermod -aG sudo user1
su - user1
sudo mkdir /var/www/ghost
sudo chown -R user1:user1 /var/www/ghost
cd /var/www/ghost
ghost install
Durante l'installazione fornisci URL del blog, nome database, utente e password. Consenti a Ghost CLI di configurare Nginx e systemd.
5. Abilitare Let's Encrypt
sudo apt-get install certbot python3-certbot-nginx -y
sudo certbot --nginx -d ghost.example.com
Scegli il reindirizzamento HTTPS.
6. Accedere a Ghost
Apri https://ghost.example.com/ghost/ e crea l'account amministratore. La dashboard apparirà dopo la configurazione iniziale.
Conclusione
Ghost è distribuito su Ubuntu 20.04 con Node.js, MariaDB, Nginx e Let's Encrypt, pronto per pubblicare e gestire contenuti.