How to install Ghost CMS on my VPS

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.

done ,

ghostcms@boringdigital:/var/www$ sudo rm -Rf /var/www/ghostcms
[sudo] password for ghostcms:
ghostcms@boringdigital:/var/www$

To be sure, let’s update ghost-cli, and then create a folder for Ghost. Replace <user> with your user ID.

sudo npm install ghost-cli@latest -g
sudo mkdir boringdigital_com
sudo chown <user>:<user> /var/www/boringdigital_com
sudo chmod 775 /var/www/boringdigital_com
cd boringdigital_com

Okay, you’re all set to install Ghost.

ghost install 4.48.1

Note:

  • Blog URL is `https://boringdigital.com
  • MySQL hostname is localhost
  • Use MySQL database name, username, and password from earlier
  • Enter y to set up Nginx, SSL, systemd and start Ghost

You should be up and running once this is completed. Please let me know how this goes.

1 Like

done ghost working !!!
you can visit https://boringdigital.com
I’m very happy. thanks for your time

2 Likes

You’re welcome, but please take some time to go through the Ubuntu tutorial I posted earlier… and mark this thread solved on my last post. Thanks.

2 Likes

Can i install anther app on the same server, I’m planning to install new forum app (discourse or wordpress on the same vps) ! ok marked solved

I expect so, depending on the specification of your VPS. For Wordpress you’ll need PHP, and do an Nginx installation. You’ll also need to setup DNS for sun-domains or an alternative domain.

I’ve not installed Discourse, so can’t help with that, but it’ll certainly run on Ubuntu.

You can install other apps on same server. Both Discourse and WordPress can be installed on same server and works fine.