This guide will show how to setup a Ghost instance on the latest stable OpenBSD 6.7 operating system using httpd, relayd, node, and sqlite3.
The first thing we need to do is setup a new user, I call mine ghost:
Next we install Node.js
Now we are going to adjust the ghost users home directory to sit within /var/www/ by creating that directory and using chsh to change the home directory in the system database:
Next we make sure our ghost user is the owner of their new home directory and we begin installing the latest ghost-cli:
Once completed you should see:
Now we need to install python3.7 and create a symbolic link to just "python" as our system wide version. Sqlite3 will not compile from source without python3.7 installed.
Now we can install sqlite3 by issuing the command "npm install sqlite3 --save , after installing it will run through a large screen of compile items and then end up here:
Now we should be ready to install ghost into a new empty directory, and are greeted with a successful install message showing our local ghost url:
At this point I am going to switch over to my actual server on the internet so I can provide DNS and create real certificates for this process, so here is me installing another ghost instance but on that server to get us to the point we are at now:
So next we will need to setup a DNS record with a new IP for this website. I do all my domain registration and DNS management from name.com:
Since this is a new record it should instantly work:
Now we need to add a new server entry to /etc/httpd.conf. If you do not have one just create it blank.
Now we need to create a new /etc/relayd.conf with an https relay entry and server entry for our new IP:
Finally we need to create new letsencrypt certs using acme-client so we add a new /etc/acme-client.conf as such:
Now in order or the acme-client to work properly you need to have httpd listening on port 443 and not forwarding block returning port 80 to 443 as well. So we modify our httpd.conf entry to look like this, and start httpd before generating our certificates:
Now we can start httpd, and hopefully generate some certs!
Now that we have valid certs we can return our httpd.conf to normal, and restart httpd again:
Now in order for relayd to work correctly it looks for the names of the certificates in IP address format. So after generating our certs we need to copy them over to IP address names within /etc/ssl/ like such:
Now we should be able to start relayd successfully:
You should be able to see in your process tree processes for httpd, relayd, and node/ghost:
Now our site should be live!!!
And that's how we setup a local ghost instance on OpenBSD with httpd, relayd, and letsencrypt!