Instructions for installing Ghost on an Orange Pi 5

2024-02-13 DEPRECATED, but you might still find it useful: Instructions are for installing Ghost on to an Orange Pi 5 to be used in conjunction with my Unraid server using a Cloudflare as Dynamic DNS Provider (DDNS) and Nginx Proxy Manager (NPM).

  1. Install the Orange Pi Ubuntu server release from http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-pi-5.html. I'm using Orangepi5_1.1.4_ubuntu_jammy_server_linux5.10.110. Username and password is orangepi by default. After burning the image to a microSD using Balena Etcher, boot off the card, find the ip address in the router, and then log in with Termius (that's the program I'm most familiar with). Do the following to install to the NVME drive, remove the card, and off you go!
sudo orangepi-config
Then choose System->Install->Boot from SPI and install the new updated boot loader to the SPI flash.
  1. Point Nginx-Proxy-Manager-Official to the VM and port 80. Make sure to install an SSL Certificate
  2. Install MySQL by following steps 3-5 from https://www.linode.com/docs/guides/install-and-configure-mysql-on-ubuntu-22-04/
sudo apt install mysql-server
sudo service mysql status
sudo cat /etc/mysql/debian.cnf
  1. Configure MySQL (ghost_database can be named anything). Take note of the user and password from the last step, you'll need it next
mysql -u USERFROMABOVE -p
PASSWORDFROMABOVE
CREATE DATABASE ghost_database;
USE database_name;
CREATE USER 'PUT USERNAME HERE'@'localhost' IDENTIFIED BY 'PUT A PASSWORD HERE';
GRANT ALL PRIVILEGES ON ghost_database.* TO 'PUT USERNAME HERE'@'localhost';
flush privileges;
quit;
  1. Install NGINX and Node.JS per https://ghost.org/docs/install/ubuntu/
sudo apt-get install nginx
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash
sudo apt-get install -y nodejs
  1. Install Ghost-CLI per https://ghost.org/docs/install/ubuntu/
sudo npm install ghost-cli@latest -g
  1. Install Ghost per Install Ghost-CLI per https://ghost.org/docs/install/ubuntu/
# Create directory: Change `sitename` to whatever you like
sudo mkdir -p /var/www/sitename

# Set directory owner: Replace <user> with the name of your user
sudo chown <user>:<user> /var/www/sitename

# Set the correct permissions
sudo chmod 775 /var/www/sitename

# Then navigate into it
cd /var/www/sitename
  1. Run the install process per https://ghost.org/docs/install/ubuntu/:
ghost install
  1. Enter the URL.
  2. Keep MySQL hostname as localhost.
  3. MySQL username / password / Ghost database name should be the same as created in #4 above.
  4. Set up NGINX? No, we'll do this manually.
  5. Set up SSL? No
  6. Set up systemd? Yes
  7. Start Ghost? Yes
  8. Configure NGINX Manually per https://vexxhost.com/resources/tutorials/how-to-install-host-ghost-with-nginx-on-ubuntu/ (this might not be exact, I had to mess around a bit to figure it out, but I think this will work)
cd /etc/nginx/
cd sites-available
sudo rm default
sudo touch ghost
cd ..
cd sites-enabled
sudo rm default
  1. Edit NGINX per https://vexxhost.com/resources/tutorials/how-to-install-host-ghost-with-nginx-on-ubuntu/ by using
sudo nano /etc/nginx/sites-available/ghost
  1. Paste the following and exit save:
server {
    listen 0.0.0.0:80;
    server_name bershatsky.net;
    access_log /var/log/nginx/ghost.log;

    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;

        proxy_pass http://127.0.0.1:2368;
        proxy_redirect off;
    }
}
  1. Create a symbolic link to activate the configuration.
sudo ln -s /etc/nginx/sites-available/ghost /etc/nginx/sites-enabled/ghost
  1. Increase upload size for NGINX by editing /etc/nginx/nginx.conf
sudo nano /etc/nginx/nginx.conf

then add the following line under http. More info here: https://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size

client_max_body_size 1000m;
  1. Restart NGINX
sudo systemctl restart nginx
  1. Install vsftpd per https://ubuntu.com/server/docs/service-ftp
sudo apt install vsftpd
  1. Edit /etc/vsftpd.conf to enable writes (delete the # before write_enable).
write_enable=YES
  1. Allow root access by editing /etc/ftpusers then remove root from the list.
  2. Enable root user by creating a password per https://linuxize.com/post/how-to-enable-and-disable-root-user-account-in-ubuntu/
sudo passwd root
  1. Restart vsftpd
systemctl restart vsftpd
  1. Reboot / Backup / Whatever