Note: Ghost is back as of 15 March 2024! This thread is now closed.

#################################################

Hi all,

As of v5.21, Ghost is no longer compatible with MariaDB and will not run with SQLite in production mode - it will only run with MySQL v8 or higher.

If you have an existing Ghost app, do not attempt to upgrade it beyond v5.20 - if you do, the site will continue to work, but you will be unable to list posts in your admin site.

Because of this situation we've decided to temporarily remove Ghost from our officially supported apps.

We hope to have a new Ghost installer in the future, but for now we'll create a new tutorial to show how to install MySQL and Ghost together manually. We should have that posted here in the forum soon.

(Edit: here's the tutorial: HOWTO run the latest Ghost with a private MySQL instance)

We will, of course, continue to provide support for the Ghost apps you've already installed and will help you if you have problems with a self-installed app.

15 days later

Thanks for writing this. I was looking for Ghost docs I could have sworn I saw here before!

Did the separate docs ever get written?

  • sean replied to this.

    horvath not just yet, apologies. I'll announce here when that is ready.

    17 days later

    horvath Not yet, really sorry about the delay! Our support load should taper off as we approach the Christmas holiday, so I'm hoping to have it done in the coming week.

      sean

      no worries.. just was curious if it was something I might be able to figure out?

      BTW, I have had some time to get back to using my account here. I was one of the herd from webfaction and haven't had time to really check things out here. Very impressive the level of automation and quality of the documentation you put out. I'm not in a crazy hurry for this. I was hoping it was one of those... "oh yea, let me publish that" kind of thing.

        horvath hey thanks for the kind feedback, I really appreciate it!

        There's not too much to be figured out, most I just need the time to do the writing. If you want to give it a shot:

        1. Create 2 proxy port apps, one for mysql and one for Ghost.
        2. Download the MySQL community server from https://dev.mysql.com/downloads/mysql/, you'll need the RHEL7/x86 version.
        3. Adapt the steps at https://community.opalstack.com/d/91-howto-install-and-run-a-private-mariadb-server-instance-on-opalstack to run your MySQL server instead of the system MariaDB server.
        4. Read the code in our Ghost installer at https://raw.githubusercontent.com/opalstack/installers/master/core/ghost/install.py to identify the tasks that it performs and then do those same tasks manually, except that you'll change the Ghost config to connect to your MySQL app instead of a SQLite database.
          5 days later

          sean

          You can see by my quick response how high a priority it is for me πŸ™‚. That was exacly the kind of response I was looking for. I'll keep track of my experience and suggest updates.

          Speaking of which.... the level of automation you have is remarkable.

          I have owned my primary domain for decades so it is never to move around. When webfaction died, I wasn't "paying attenion".

          You guys are doing it right!
          .

          4 months later

          I don’t see Ghost listed in the application list. Does that mean the bundled installer is still not available?

          • nick replied to this.

            justincox Yes, please see the OP at the start of the thread.

            Because of this situation we've decided to temporarily remove Ghost from our officially supported apps.

            Still no ETA at this time but we will make an announcement here.

              nick Are the steps from December still accurate or are there newer versions to follow?

              • nick replied to this.

                justincox I think so, though if you have any issues feel free to open a support ticket.

                THIS GUIDE IS DEPRECIATED AS OF GHOST 5.71.0 SINCE IT DROPPED NODE 16 SUPPORT, PLEASE USE THE DEDICATED INSTALL GUIDE.

                For anyone interested - these instructions should get a Ghost/MySQL instance up and running in production mode on the Opalstack platform. Here are the variables you need to know in order to use the guide (replace them with the values you choose to assign to each):

                MYGHOST = new shell user name
                GHOSTAPP = nginx proxy app 1, note assigned port = GAPORT
                GHOSTDB = nginx proxy app 2, note assigned port = DBPORT
                GHOSTDBNAME = ghost database name
                GHOSTDBUSER = ghost db user name
                GHOSTDBUSERPWD = ghost db user password
                GHOSTDBROOTPWD = ghost db root user password
                YOURDOMAIN.COM = domain to use for the app

                Pre-installation

                1. Create a new shell user, e.g. MYGHOST
                2. Create two NXINX proxy apps GHOSTAPP and GHOSTDB, noting the assigned ports for each
                3. Create a site record in dashboard assigning GHOSTAPP and YOURDOMAIN.COM, enabling HTTPS too
                4. SSH to your server using shell user MYGHOST

                Setup MySQL Instance

                **#Create the MySQL config file**
                cd ~/apps/GHOSTDB
                mkdir -p {etc,var,tmp}
                echo -e "[client]\nport = DBPORT\nsocket = /home/MYGHOST/apps/GHOSTDB/var/mysql.sock\n\n[mysqld]\nport = DBPORT\nsocket = /home/MYGHOST/apps/GHOSTDB/var/mysql.sock\ntmpdir = /home/MYGHOST/apps/GHOSTDB/tmp\ndatadir = /home/MYGHOST/apps/GHOSTDB/data\ninnodb_log_group_home_dir = /home/MYGHOST/apps/GHOSTDB/data\nlog_error = /home/MYGHOST/apps/GHOSTDB/maria.log\npid_file = /home/MYGHOST/apps/GHOSTDB/var/pid\nsql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION\n\n[mysqld_safe]\nlog-error = /home/MYGHOST/apps/GHOSTDB/maria.log\npid-file = /home/MYGHOST/apps/GHOSTDB/var/pid" > ~/apps/GHOSTDB/etc/my.cnf
                
                **#Download and setup MySQL**
                wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.32-el7-x86_64.tar.gz
                tar xzf mysql-8.0.32-el7-x86_64.tar.gz --strip-components=1
                ~/apps/GHOSTDB/bin/mysqld --defaults-file=/home/MYGHOST/apps/GHOSTDB/etc/my.cnf --initialize-insecure --user=$USER --datadir=$PWD/data --tmpdir=$PWD/tmp
                
                **#Start the MySQL instance, login and set up root and new user:**
                nohup $HOME/apps/GHOSTDB/bin/mysqld_safe --defaults-file=$HOME/apps/GHOSTDB/etc/my.cnf --socket=$HOME/apps/GHOSTDB/var/mysql.sock > $HOME/apps/GHOSTDB/nohup.out 2>&1 &
                ~/apps/GHOSTDB/bin/mysql -P DBPORT -S $HOME/apps/GHOSTDB/var/mysql.sock -u root
                ALTER USER 'root'@'localhost' IDENTIFIED BY 'GHOSTDBROOTPWD';
                create database GHOSTDBNAME;
                create user 'GHOSTDBUSER'@'localhost' identified by 'GHOSTDBUSERPWD';
                grant usage on *.* to 'ghostdbuser'@'localhost';
                grant all on GHOSTDBNAME.* to 'GHOSTDBUSER'@'localhost';
                FLUSH PRIVILEGES;
                EXIT;
                
                **#How to start/stop database**
                Start: nohup $HOME/apps/GHOSTDB/bin/mysqld_safe --defaults-file=$HOME/apps/GHOSTDB/etc/my.cnf --socket=$HOME/apps/GHOSTDB/var/mysql.sock > $HOME/apps/ghostdb/nohup.out 2>&1 &
                Stop: $HOME/apps/GHOSTDB/bin/mysqladmin -u root -P DBPORT -S $HOME/apps/GHOSTDB/var/mysql.sock -p shutdown

                Setup Ghost Instance w/MySQL -- NOTE: Node v16 support has been dropped as of Ghost 5.71.0 so you will have to compile Node v18.12.1 instead, see the updated official guide here.

                **#Get and unpack Nodejs v16.20.0**
                cd ~/apps/GHOSTAPP/
                wget https://nodejs.org/download/release/latest-v16.x/node-v16.20.0-linux-x64.tar.xz
                tar xf node-v16.20.0-linux-x64.tar.xz --strip 1 -C $PWD
                
                **#Export for Node PATH, update NPM and install some Ghost requirements via SCL**
                export PATH=$HOME/apps/GHOSTAPP/bin:$HOME/apps/GHOSTAPP/node_modules/.bin:$PATH
                scl enable devtoolset-10 -- npm install -g npm@9.8.1
                scl enable devtoolset-10 -- npm install --prefix=~/apps/GHOSTAPP @vscode/sqlite3
                scl enable devtoolset-10 -- npm install --prefix=~/apps/GHOSTAPP ghost-cli@latest
                
                **#Install the Ghost instance**
                mkdir ./instance && cd ./instance
                ~/apps/GHOSTAPP/node_modules/.bin/ghost install local --port GAPORT --log file --no-start
                
                **#Replace the sqlite3 package**
                rm -r ~/apps/GHOSTAPP/instance/current/node_modules/sqlite3
                cp -r ~/apps/GHOSTAPP/node_modules/@vscode/sqlite3 ~/apps/ghostapp/instance/current/node_modules/
                
                **#Create the Ghost config file for production, disable default config files**
                echo -e '{ \n\t"url": "https://YOURDOMAIN.COM", \n\t"server": { \n\t\t"host": "127.0.0.1", \n\t\t"port": GAPORT }, \n\t"database": { \n\t\t"client": "mysql", \n\t\t"connection": { \n\t\t\t"host": "127.0.0.1", \n\t\t\t"port": DBPORT, \n\t\t\t"user": "GHOSTDBUSER", \n\t\t\t"password": "GHOSTDBUSERPWD", \n\t\t\t"database": "GHOSTDBNAME" \n\t\t} \n\t}, \n\t"paths": { \n\t\t"contentPath": "/home/MYGHOST/apps/GHOSTAPP/instance/content/" \n\t}, \n\t"logging": { \n\t\t"level": "info", \n\t\t"rotation": { \n\t\t\t"enabled": true \n\t\t}, \n\t\t"transports": [\n\t\t\t"file", \n\t\t\t"stdout"\n\t\t], \n\t\t"path": "/home/MYGHOST/logs/apps/GHOSTAPP/"\n\t} \n}' > ~/apps/GHOSTAPP/instance/config.production.json
                find ~/apps/GHOSTAPP/instance/versions/X.XX.X/core/shared/config/env/ -type f -name "*.json" -exec sh -c 'mv "$1" "${1%.json}.json-backup"' _ {} \;
                **#NOTE**: Replace X.XX.X with the version number that got installed when you used 'ghost install' prior
                
                **#Create start and stop scripts**
                echo '#!/bin/bash' > ~/apps/GHOSTAPP/start; echo "PATH=~/apps/GHOSTAPP/bin:\$PATH" >> ~/apps/GHOSTAPP/start; echo "NODE_ENV=production ~/apps/GHOSTAPP/node_modules/.bin/ghost start -d ~/apps/GHOSTAPP/instance --no-setup-linux-user" >> ~/apps/GHOSTAPP/start; chmod +x ~/apps/GHOSTAPP/start; echo '#!/bin/bash' > ~/apps/GHOSTAPP/stop; echo "PATH=~/apps/GHOSTAPP/bin:\$PATH" >> ~/apps/GHOSTAPP/stop; echo "~/apps/GHOSTAPP/node_modules/.bin/ghost stop -d ~/apps/GHOSTAPP/instance --no-setup-linux-user" >> ~/apps/GHOSTAPP/stop; chmod +x ~/apps/GHOSTAPP/stop
                
                **#Start Ghost**
                ~/apps/GHOSTAPP/start

                Post setup instructions

                **#Set domain you want to serve the Ghost app with**
                cd ~/apps/GHOSTAPP/instance
                ~/apps/GHOSTAPP/node_modules/.bin/ghost config url https://YOURDOMAIN.COM
                ~/apps/GHOSTAPP/node_modules/.bin/ghost restart
                
                **#Immediately visit your Ghost admin URL and create the admin user when it's available, e.g.**
                https://YOURDOMAIN.COM/ghost/
                **#NOTE**: If this process appears to stall, after about 15-20 seconds or so just click the black button you just did again and it should take you to a login page. I haven't seen any problems that stem from this issue yet and the logs were not clear why this was happening.
                
                **#Add cron to keep the app up**
                (crontab -l 2>/dev/null; echo "0,10,20,30,40,50 * * * * ~/apps/GHOSTAPP/start > /dev/null 2>&1") | crontab -
                
                **#How to start/stop/restart Ghost app**
                ~/apps/GHOSTAPP/start
                ~/apps/GHOSTAPP/stop
                export PATH=$HOME/apps/GHOSTAPP/bin:$HOME/apps/GHOSTAPP/node_modules/.bin:$PATH && cd ~/apps/GHOSTAPP/instance && ~/apps/GHOSTAPP/node_modules/.bin/ghost restart
                
                **#Don't forget to setup mail!**
                https://ghost.org/docs/config/#mail (note: you have to restart Ghost after modifying any of the config json files)

                Updates and maintenance

                To run the ghost command for updates and other maintenance tasks, first set your shell path by running the following command:

                export PATH=$HOME/apps/GHOSTAPP/bin:$HOME/apps/GHOSTAPP/node_modules/.bin:$PATH

                You'll then be able to run ghost for updates etc, for example:

                export PATH=$HOME/apps/GHOSTAPP/bin:$HOME/apps/GHOSTAPP/node_modules/.bin:$PATH
                cd $HOME/apps/GHOSTAPP/instance
                ghost backup --no-setup-linux-user
                ghost update --no-setup-linux-user

                More ghost commands are documented at: https://ghost.org/docs/ghost-cli/

                I hope this has been helpful in leui of the current Ghost installer issues! πŸ™‚πŸ™‚πŸ™‚

                  Hi everyone, I made some significant updates to the MySQL section of the build details as it was reportedly showing versioning issues with the original instructions. It might be better to start from scratch if you are not comfortable updating an existing Ghost app that was using the old DB method if you've already set everything up. As always, feel free to let us know if you are having any issues and we will happily help πŸ™‚

                  Mastodon