Friendly Ghost
Command Line

© Lead Image, toa-heftiba, Unsplash.com
Blogging usually implies WordPress, but Ghost presents a serious challenge.
According to an analysis by W3Techs [1], neither Google nor Amazon control the Internet – the WordPress content management system (CMS) does. They say the open source CMS now drives 30 percent of all websites, which translates to a market share of just over 60 percent. Thus, you are unlikely to go a day without stumbling across a WordPress page while browsing.
Even though most web developers are looking for one of the usual candidates from the CMS trio of WordPress, Joomla, and Drupal, you should take a look at the CMS inhabiting the bottom of the W3Techs list. The still quite new Ghost [2] has only secured a small share of the market, but its modern approach and its active community make the CMS interesting for open source-minded bloggers.
Ghostly
In contrast to WordPress, the Ghost CMS does not rely on PHP, but on JavaScript and Node.js, which makes it a bit difficult to get started. However, the modern web platform plays to its strengths. The idea for Ghost came from Hannah Wolfe and John O'Nolan, who gained great experience in CMS as the former deputy head of design of the WordPress team. O'Nolan no longer sees WordPress as the simple tool for bloggers that it once was, but as a platform for all kinds of web projects [3]. With a handful of plugins, you can set up virtually any project on the web, from a bug tracker to a web shop to an online community.
Its great flexibility is also the biggest weakness of WordPress: The CMS has lost its focus on the original target group, bloggers, which are exactly who Ghost is now targeting. The project was given a significant boost by a successful Kickstarter campaign. In just under a month, around £200,000 came together, which was far more than the £25,000 funding target [4].
The Ghost Foundation emerged from the accumulated capital and developed and managed the code under the MIT license as a non-profit organization. The foundation currently employs eight people, and the steadily growing community contributes time and code to the project. As with WordPress, the Ghost CMS is available for self-hosting, or Ghost(Pro) [5] is offered as a hosted version for a fee starting at $19 a month.
Drafted
Ghost recommends Ubuntu 16.04 with 1GB of RAM, MySQL as the database back end, and Nginx as the web server. As a JavaScript application based on Node. js [6], Ghost provides its own web server. Node.js listens for requests on port 1024 or greater so that the service does not have to run with root privileges, and Nginx accepts requests on ports 80 and 443 (for SSL) as a reverse proxy before passing them on to Ghost. In a test on Ubuntu Server 17.10, Ghost proved in our lab that it can handle a state-of-the-art software stack.
As a prerequisite, we assume that the server can be reached over an Internet domain. In the case of a home server connected to the Internet via DSL or cable, you must ensure that the URL is accessible via DynDNS and forward ports 80 and 443 from the router to the server. Refer to the Installation Guide [7] to update the server and install Nginx and MySQL. The system requests a root password for the SQL server (which you must remember); then, you need to activate the web server in the firewall (Listing 1).
Listing 1
Activating Web Server
$ sudo apt update $ sudo apt full-upgrade $ sudo apt install nginx mysql-server $ sudo ufw allow 'Nginx Full'
Nodes
Ghost developers recommend using the 6.x LTS branch of Node.js. Ubuntu 16.04 and newer is the easiest way to load it via nodesource.com. The installation script inserts a package source into the system, from which it then installs the application. With the node package manager (npm
), you can install the ghost-cli
setup wizard:
$ wget https://deb.nodesource.com/setup_6.x $ chmod +x setup_6.x $ sudo ./setup_6.x $ sudo apt install nodejs $ sudo npm i -g ghost-cli
At first glance, this procedure might seem complicated, but it saves much time and effort in the long run.
At this point, you have created the necessary prerequisites to put the blog system on the server:
$ sudo mkdir -p /var/www/ghost $ sudo chown <User>:<Group> /var/www/ghost $ cd /var/www/ghost $ LANG=C ghost install
The first line creates the /var/www/ghost/
working directory; the second line assigns the user rights to the folder. Next, you switch to the newly created directory, which must be empty, and run the installation wizard. The LANG=C
changes the language settings to the default locale; otherwise, the script runs into an error and terminates.
The installation routine first wants to know the blog URL, the address of the MySQL server, the root login, and the previously assigned MySQL password, as well as a name for the database. You can enter the URL to access the blog later. If the blog and database are on the same computer, the address for the MySQL server is localhost. The database does not have to exist: The setup creates it, if necessary.
The Ghost command-line interface (CLI) handles most of the maintenance work and the installation. You can install the current version with ghost update
. Alternatively, take a look at what's going on behind the scenes with ghost log
. For information on all options of the Ghost client for the command line, enter ghost help
.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.
News
-
Zorin OS 17 Beta Available for Testing
The upcoming version of Zorin OS includes plenty of improvements to take your PC to a whole new level of user-friendliness.
-
Red Hat Migrates RHEL from Xorg to Wayland
If you've been wondering when Xorg will finally be a thing of the past, wonder no more, as Red Hat has made it clear.
-
PipeWire 1.0 Officially Released
PipeWire was created to take the place of the oft-troubled PulseAudio and has finally reached the 1.0 status as a major update with plenty of improvements and the usual bug fixes.
-
Rocky Linux 9.3 Available for Download
The latest version of the RHEL alternative is now available and brings back cloud and container images for ppc64le along with plenty of new features and fixes.
-
Ubuntu Budgie Shifts How to Tackle Wayland
Ubuntu Budgie has yet to make the switch to Wayland but with a change in approaches, they're finally on track to making it happen.
-
TUXEDO's New Ultraportable Linux Workstation Released
The TUXEDO Pulse 14 blends portability with power, thanks to the AMD Ryzen 7 7840HS CPU.
-
AlmaLinux Will No Longer Be "Just Another RHEL Clone"
With the release of AlmaLinux 9.3, the distribution will be built entirely from upstream sources.
-
elementary OS 8 Has a Big Surprise in Store
When elementary OS 8 finally arrives, it will not only be based on Ubuntu 24.04 but it will also default to Wayland for better performance and security.
-
OpenELA Releases Enterprise Linux Source Code
With Red Hat restricting the source for RHEL, it was only a matter of time before those who depended on that source struck out on their own.
-
StripedFly Malware Hiding in Plain Sight as a Cryptocurrency Miner
A rather deceptive piece of malware has infected 1 million Windows and Linux hosts since 2017.