Ech0 - 00 / 00 / 00

Ghost Blogging

Before we start, you will need a Debian 10+ VPS (you can get one on digitalocean for example), if you prefer to use your own self hosted server, make sure that port 80 and 443 are correctly port forwarded so that the public ip points to the server and not the router. Once that's done, go and ssh into your debian 10 server.

You can use DuckDNS to get a free domain name:


[ 192.168.100.1/24 ] [ /dev/pts/13 ] [~/Documents/Github/blog/Conf]
→ ssh root@ech4.duckdns.org
The authenticity of host 'ech4.duckdns.org (178.128.46.38)' can't be established.
ECDSA key fingerprint is SHA256:z2HAncB99pfbAUfj9tJY7vlo8EGUzCIUxWBAnjAflcA.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'ech4.duckdns.org,178.128.46.38' (ECDSA) to the list of known hosts.
Linux debian-s-1vcpu-1gb-lon1-01 4.19.0-10-cloud-amd64 #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
root@debian-s-1vcpu-1gb-lon1-01:~#

Initial Setup


apt update -y && apt upgrade -y
apt install git nginx sqlite3 sudo curl -y

# Using Debian, as root
curl -sL https://deb.nodesource.com/setup_14.x | bash -
apt install nodejs gcc g++ make -y

npm install ghost-cli@latest -g

adduser ghostuser
usermod -aG sudo ghostuser
sudo -u ghostuser -i

sudo mkdir -p /var/www/ghost
sudo chown ghostuser: /var/www/ghost
sudo chmod 775 /var/www/ghost
cd /var/www/ghost



ghost install --db=sqlite3

Then install the systemd service if the previous command fails at the service setup part:


ghost setup systemd

Then edit the configuration file:


cd /var/www/ghost/
nano config.production.json

In here you put the final URL (and then CTRL+S to save and CTRL+X to exit nano)


systemctl restart ghost_localhost

If you want https for your website, you'll need a domain name (you can get a free one at https://duckdns.org) and then use nginx https reverse proxy pointing to the server's ip address and port.


wget https://ech1.github.io/blog/servers/ghost/ghost_rproxy.conf -O /etc/nginx/sites-available/ghost.conf
ln -s /etc/nginx/sites-available/ghost.conf /etc/nginx/sites-enabled/ghost.conf
nano /etc/nginx/sites-available/ghost.conf
nginx -t 

Change the domain name to match yours:

From here, use acme.sh to get your certificates:


wget -O -  https://get.acme.sh | sh
source ~/.bashrc

systemctl stop nginx 
acme.sh --issue --standalone -d ghost.duckdns.org -k 4096
systemctl start nginx

systemctl enable --now ghost_localhost

Now to create your admin account:

And there you have it! We have been able to publish our first blogpost on our own ghost platform.



2



3




	

	

	

My Bunker

Some Address 67120,
Duttlenheim, France.

About Ech0

This cute theme was created to showcase your work in a simple way. Use it wisely.