How to install Ghost CMS on my VPS

I try to install Ghost CMS on my VPS(1.5 GB ram with 100 Gb storage). process with errors and my browser stuck on ubuntu apache error message, I follow your documentation step by step but no one works.
How to install & setup Ghost on Ubuntu 16.04, 18.04 and 20.04
I get two diffrents errors, first one show Nginx not working and second one show installation success but not working on my chrome browser(my url stuck on Apach2 ubuntu)

.
Command to allow Nginx working properly (errors)

sudo ufw allow 'Nginx Full'

I get some errors with Data Base too.
I try some random installation online than found some useful articles about Ghost installation for example : Cara Install Ghost di Ubuntu 20.04 • Musa Amin
can you help to install Ghost version [4.48.1] (Release 4.48.1 · TryGhost/Ghost · GitHub)
please !

Can you share some info about your VPS, e.g., OS you’re running (I assume Ubuntu 20.04) plus the errors you are seeing. Also, is anything else running on this server? For instance, why are you running Apache2? What database did you install? Why aren’t you installing Ghost V5?

1 Like

✔ Checking system Node.js version - found v16.15.1
✔ Checking logged in user
✔ Checking current folder permissions
System checks failed with message: 'Missing package(s): nginx'
Some features of Ghost-CLI may not work without additional configuration.
For local installs we recommend using `ghost install local` instead.

some OS info

I follow Install Ghost CMS on Ubuntu 22.04|20.04|18.04 | ComputingForGeeks
I prefer older version, casper looks good and very simple compare to the newst version, can you suggest some commands to choose specific Ghost version and not the latest one. I try some random command online, unfortunately(nothing happen)

sudo ufw allow 'Nginx Full'
sudo: ufw: command not found

check my website Apache2 Ubuntu Default Page: It works (boringdi
gital.com)


I try Ghost ls, showing success!

Visit boringdigital.com you will find apach ubuntu!

That’s because you’ve setup Apache and it is serving the default page (probably /var/www/html/index.html) for the bare domain.

First, why have you installed Apache2? You need to proxy Ghost, and Nginx is recommended for this. So, can you confirm if Nginx is installed and configured to proxy port 2368, and if Apache2 is needed? Likewise, have you, or do you want to, setup SSL?

any recommendation or command to fix default page! Apache2 come with nginx or installed by default on my vps! Yes Nginx installed and active, How to configure to proexy port 2368, yes I want to setup ssl but sudo ufw allow 'Nginx Full' not working

Okay, let’s remove Apache2 first:

sudo apt purge apache2
sudo apt remove apache2-common

Next, please share the output from these commands:

sudo dpkg -l | grep -i apache
sudo ufw app list
cd /var/www/ghostcms/boringdigital.com
ghost doctor

Now, please show me the directory listings for /etc/nginx/sites/enabled and /etc/nginx/sites/available.

First command


ii  apache2-bin                    2.4.29-1ubuntu4.23                  amd64        Apache HTTP Server (modules and other binary files)
ii  apache2-data                   2.4.29-1ubuntu4.23                  all          Apache HTTP Server (common files)
ii  apache2-doc                    2.4.29-1ubuntu4.23                  all          Apache HTTP Server (on-site documentation)
ii  apache2-utils                  2.4.29-1ubuntu4.23                  amd64        Apache HTTP Server (utility programs for web servers)
ii  libapr1:amd64                  1.6.3-2                             amd64        Apache Portable Runtime Library
ii  libaprutil1:amd64              1.6.1-2                             amd64        Apache Portable Runtime Utility Library
ii  libaprutil1-dbd-sqlite3:amd64  1.6.1-2                             amd64        Apache Portable Runtime Utility Library - SQLite3 Driver
ii  libaprutil1-ldap:amd64         1.6.1-2                             amd64        Apache Portable Runtime Utility Library - LDAP Driver

Second command

sudo: ufw: command not found
✔ Checking system Node.js version - found v16.15.1
ℹ Ensuring user is not logged in as ghost user [skipped]
ℹ Checking if logged in user is directory owner [skipped]
✔ Checking current folder permissions
Instance is currently running
ℹ Validating config [skipped]
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space

You can visit boringdigital.com

Did you execute all the commands to remove Apache2? At least Nginx is running instead. However, you haven’t given me the output from /etc/nginx/sites/enabled and /etc/nginx/sites/available.

It doesn’t look like you have ufw installed. I’m guessing you haven’t hardened your server either, but that’s another topic.

Regarding ghost doctor, I want to see something like this:

$ ghost doctor

Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js


✔ Checking system Node.js version - found v16.15.0
✔ Checking logged in user
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
✔ Checking system compatibility
✔ Checking for a MySQL installation
+ sudo systemctl is-active ghost_thelazyleader-co
Instance is currently running
ℹ Validating config [skipped]
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
✔ Checking systemd unit file
✔ Checking systemd node version - found v16.15.0

some out
sudo ufw app list

Available applications:
  Bind9
  Nginx Full
  Nginx HTTP
  Nginx HTTPS
  OpenSSH

How ! some command to show the directory listings for /etc/nginx/sites/enabled
Out put


ghostcms@boringdigital:/var/www/ghostcms/boringdigital.com$ ghost doctor

Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js

Running in development mode

✔ Checking system Node.js version - found v16.15.1
ℹ Ensuring user is not logged in as ghost user [skipped]
ℹ Checking if logged in user is directory owner [skipped]
✔ Checking current folder permissions
Instance is currently running
ℹ Validating config [skipped]
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
ghostcms@boringdigital:/var/www/ghostcms/boringdigital.com$


bash: /etc/nginx/sites/available: No such file or directory

I think you need to do some homework, and learn some Linux command-line basics.

To list the folders, use this:

ls -Flai /etc/nginx/sites-enabled
ls -Flai /etc/nginx/sites-available

I’d also like to see the output from these commands:

sudo dpkg -l | grep -i mariadb
sudo dpkg -l | grep -i mysql
1 Like

Thanks,
check out put

sites-enabled
total 8
395002 drwxr-xr-x 2 root root 4096 Jun  4 13:26 ./
394968 drwxr-xr-x 8 root root 4096 Jun  4 13:26 ../
395169 lrwxrwxrwx 1 root root   34 Jun  4 13:26 default -> /etc/nginx/sites-avai   lable/default

ghostcms@boringdigital:/var/www/ghostcms/boringdigital.com$ ls -Flai /etc/nginx/sites-available
total 12
394996 drwxr-xr-x 2 root root 4096 Jun  4 13:26 ./
394968 drwxr-xr-x 8 root root 4096 Jun  4 13:26 ../
394999 -rw-r--r-- 1 root root 2416 Apr  6  2018 default

ii  libdbd-mysql-perl              4.046-1                             amd64        Perl5 database interface to the MariaDB/MySQL database
ii  mariadb-client-10.1            1:10.1.48-0ubuntu0.18.04.1          amd64        MariaDB database client binaries
ii  mariadb-client-core-10.1       1:10.1.48-0ubuntu0.18.04.1          amd64        MariaDB database core client binaries
ii  mariadb-common                 1:10.1.48-0ubuntu0.18.04.1          all          MariaDB common metapackage
ii  mariadb-server                 1:10.1.48-0ubuntu0.18.04.1          all          MariaDB database server (metapackage depending on the latest version)
ii  mariadb-server-10.1            1:10.1.48-0ubuntu0.18.04.1          amd64        MariaDB database server binaries
ii  mariadb-server-core-10.1       1:10.1.48-0ubuntu0.18.04.1          amd64        MariaDB database core server files

Okay, so you’re not set up properly. This is what I would like you to do. Take your time and don’t miss a step. If you encounter any errors, stop, and post here.

sudo rm /etc/nginx/sites-enabled/default
sudo systemctl stop mariadb
sudo apt purge mariadb-*

Confirm you uninstalled MariaDB, by executing the following. If successful, there will be no output.

sudo dpkg -l | grep mariadb

Now we will remove all traces of MySQL.

sudo apt purge mysql-*

Once again, let’s check that this worked.

sudo dpkg -l | grep mysql

Now we will tidy up.

sudo apt autoremove
sudo apt autoclean
sudo rm /etc/apt/sources.list.d/mariadb.list

We can install MySQL8 now.

sudo apt update
sudo apt install mysql-server
sudo systemctl start mysql.service
sudo mysql_secure_installation

When prompted, type n for password validation, and y for all other questions.

Now, let’s pause a moment. I’d like you to confirm this worked before we do a little SQL, and reinstall Ghost.

1 Like

all steps done! perfect.

1 Like

Okay, next steps are to create a database and database user for Ghost.

Type sudo mysql and you’ll see a different prompt. This is because you are using MySQL and have left the BASH command-line. You’ll need to replace <password> with your password; create a new one for this.

create database boringdigital_com;
create user 'user_boringdigital_com'@'localhost' identified by '<password>';
grant all privileges on boringdigital_com.* to 'user_boringdigital_com'@'localhost';
flush privileges;
quit;

Please let me know how this goes.

all steps done, I need Ghost with 4.x version not latest !

1 Like

Is there a reason for this, e.g., the theme currently doesn’t support Ghost V5?

Furthermore, please confirm the version of nodejs:

node -v
1 Like
v16.15.1

I love older version of ghost

1 Like

Okay, but don’t leave upgrading too long, as you’ll create a headache for later. :slight_smile:

So, first up, we’re going to remove the current Ghost installation.

cd /var/www/ghostcms/boringdigital.com
ghost uninstall

If all is good, let’s go to /var/www and clean up.

cd /var/www
rm -Rf /var/www/ghostcms

Now we’re ready for a clean installation. So, please let me know how that went.