Ghost¶
Ghost is a content management system for blogs with additional features like newsletters and monetized subscriptions.
Installation¶
Note
The recommended production database for Ghost is MySQL v8 which is available only on our AlmaLinux 9 servers. MySQL is not available on our CentOS 7 servers and as a result Ghost on those servers uses SQLite.
If your hosting plan is on a CentOS 7 server and and you want to run Ghost with the recommended production database then please contact the Opalstack support team to arrange a migration to an AlmaLinux 9 server.
To install a Ghost application follow our general instructions for adding applications and select "Ghost" as the application type in step 5.
When the installation is complete the app will be installed in the directory /home/shelluser/apps/myapp, replacing "shelluser" is the name of your app's shell user and "myapp" is the name of your app.
The following files and directories will be present in the application directory:
startandstopscripts to control the operation of your app.setenv: a script to configure your shell environment when working with your app.ghost: a directory containing your Ghost instance and the Ghost configuration file.node: a directory containing the core Ghost softwareREADME: basic info regarding the new app.
Post-Install Steps - IMPORTANT!¶
-
Assign your Ghost application to a site in your dashboard and make a note of the site URL.
-
Log in to SSH as your app's shell user and run the following commands to configure the site URL, replacing
https://domain.comwith your site URL andmyappwith your Ghost app's name:source ~/apps/myapp/setenv cd ~/apps/myapp/ghost ghost config url https://domain.com ghost restart -
Immediately visit your Ghost admin URL (for example https://domain.com/ghost/) to set up your initial admin user.
Configuring Ghost to use SMTP email¶
Your Ghost app is intially configured to use sendmail for its outgoing mail. If you would prefer to use a SMTP server for your site's outgoing mail then log in to SSH as your app's shell user and take the following steps, replacing myapp with your Ghost app's name:
-
Execute the following commands:
source ~/apps/myapp/setenv cd ~/apps/myapp/ghost # replace 'nano' below with your preferred editor nano config.production.json -
Modify the
mailsection of the config like so:"mail": { "transport": "smtp", "options": { "service": "Your Mail Provider", "host": "your_smtp_server", "port": 587, "secure": false, "auth": { "user": "your_smtp_login", "pass": "your_smtp_password" } } },The values to use for Opalstack's SMTP are available at: Email Client Configuration
-
Save your changes and exit your editor.
-
Restart Ghost with the following command:
ghost restart
Installing packages for Ghost with npm¶
To install additional Javascript packages for your Ghost application SSH to the server as your app's shell user and run the following commands, replacing myapp with your Ghost app's name and package_name with the name of the package:
source ~/apps/myapp/setenv
cd ~/apps/myapp/node
npm install package_name
If the installed package includes binary components that aren't compatible with the server then the package may not work correctly. If you run into binary compatibility issues then try re-installing the package with the NPM_CONFIG_BUILD_FROM_SOURCE environment variable set:
source ~/apps/myapp/setenv
cd ~/apps/myapp/node
NPM_CONFIG_BUILD_FROM_SOURCE=true npm install package_name
