2 min read

Ghost Install on Uberspace 7

This small guide explains how to install the latest version of ghost on your Uberspace 7 using the ghost-cli.
Ghost Install on Uberspace 7

This small guide explains how to install the latest version of ghost on your Uberspace 7 using the ghost-cli. Inspired by this guide by Arthur Mühlbeier (German) for the beta and the old guide for Uberspace 6 (also German).

Update: Uberspace is so great, they already had a guide for Ghost, which does the exact same thing as mine, just better.


  • Point your url to your Uberspace using the following command (also see Uberspace Manual):
    uberspace web domain add yourdomain.tld
  • Find an empty port by entering this into your shell:
    GHOSTPORT=$(( $RANDOM % 4535 + 61000)); netstat -tulpen | grep $GHOSTPORT && echo "versuch's nochmal"
    If there's no output you found one. You can get it by entering echo $GHOSTPORT
  • Find your MySQL password in ~/.my.cnf. See also Uberspace Manual for MySQL. Be careful not to get the wrong one! The second account is read only; this will result in lots of errors when you start the server.

Base Install

Install the ghost-cli first:

npm install -g ghost-cli@latest

Now we either execute ghost install -d ~/ghost --no-setup-linux-user and prompt our way through (you dont want to setup anything that is managed by the Uberspace team such as mysql, nginx, systemd and ssl) or execute the command below with the right parameters. You should change everything written in CAPS.

ghost install -d ~/ghost --no-stack --url https://YOURDOMAIN.TLD --port $GHOSTPORT --db mysql --dbuser $USER --dbpass YOURDBPASSWORD --dbname $USER --process local --no-start --no-setup-mysql --no-setup-nginx --no-setup-ssl --no-setup-systemd --no-setup-linux-user --no-prompt

Ghost should now be installed in ~/ghost.

Make Ghost accessible from the outside

To make the Ghost server, which will only be running locally, accessible to the outside we need to proxy the requests to the server. For this we create a directory with the name of your (sub-)domain.

mkdir /var/www/virtual/$USER/yourdomain.tld

Now we create an .htaccess file which redirects all requests to the port where your ghost instance is running. Just copy the whole thing into your shell:

cat <<__EOF__ >/var/www/virtual/$USER/comments.yourdomain.tld
DirectoryIndex disabled
RewriteEngine On
RewriteRule ^(.*) http://localhost:GHOSTPORT/$1 [P]

Create a service file

Now we create the service file for ghost ~/etc/services.d/ghost.ini with the following content (as explained on the Uberspace Manual to supervisord). Again just copy the command right into your shell:

cat <<__EOF__ >~/etc/services.d/ghost.ini
command=/home/$USER/bin/ghost run
environment = NODE_ENV="production"

Lastly reread the services directory and update the services:

supervisorctl reread
supervisorctl update

That's it!

If everything worked Ghost is now available on yourdomain.tld, or alternatively under yourusername.uber.space
You can now go to https://yourdomain.tld/ghost and start writing your blog!

Thanks for reading! If you have questions, leave a comment below!
If you also want a comment section on your blog, check out my post on comments


P.S.: Here's a small and "stupid" script that just executes the aforementioned commands in order, but reads your domain and passwords automatically. Just execute it and hit Enter if the url is correct. Use at your own risk!

  1. Download this script
    curl -O 'https://raw.githubusercontent.com/M4a1x/uberspace-ghost/master/setup_ghost.sh'
  2. Make it executable:
    chmod +x setup_ghost.sh
  3. Execute it
  4. Press Enter if URL is correct, otherwise enter yourdomain.tld
  5. Go to yourdomain.tld and enjoy your new blog!