How to Install Ghost on Debian 13

Ghost is a free and open-source blogging platform written in JavaScript and distributed under the MIT License, designed to simplify the process of online publishing for individual bloggers as well as online publications.

Update the System.

apt update -y 

apt upgrade -y

Install sudo command using below command,

apt-get install sudo 

Install build-essential using below command,

apt install build-essential

Output:

apt install build-essential
The following package was automatically installed and is no longer required:
  linux-image-6.12.33+deb13-amd64
Use 'apt autoremove' to remove it.

Installing:
  build-essential

Installing dependencies:
  binutils                   libalgorithm-diff-perl     libhwasan0
  binutils-common            libalgorithm-diff-xs-perl  libisl23
  binutils-x86-64-linux-gnu  libalgorithm-merge-perl    libitm1
  cpp                        libasan8                   liblsan0
  cpp-14                     libbinutils                libmpc3
  cpp-14-x86-64-linux-gnu    libc-dev-bin               libmpfr6
  cpp-x86-64-linux-gnu       libc6-dev                  libquadmath0
  dpkg-dev                   libcc1-0                   libsframe1
  fakeroot                   libcrypt-dev               libstdc++-14-dev
  g++                        libctf-nobfd0              libtsan2
  g++-14                     libctf0                    libubsan1
  g++-14-x86-64-linux-gnu    libdpkg-perl               linux-libc-dev
  g++-x86-64-linux-gnu       libfakeroot                make
  gcc                        libfile-fcntllock-perl     manpages-dev
  gcc-14                     libgcc-14-dev              patch
  gcc-14-x86-64-linux-gnu    libgomp1                   rpcsvc-proto
  gcc-x86-64-linux-gnu       libgprofng0                sq

Suggested packages:
  binutils-doc               gcc-14-doc       gdb-x86-64-linux-gnu
  gprofng-gui                gcc-multilib     libc-devtools
  binutils-gold              autoconf         glibc-doc
  cpp-doc                    automake         git
  gcc-14-locales             libtool          bzr
  cpp-14-doc                 flex             libstdc++-14-doc
  debian-keyring             bison            make-doc
  debian-tag2upload-keyring  gdb              ed
  g++-multilib               gcc-doc          diffutils-doc
  g++-14-multilib            gcc-14-multilib

Summary:
  Upgrading: 0, Installing: 52, Removing: 0, Not Upgrading: 0
  Download size: 81.8 MB
  Space needed: 310 MB / 18.5 GB available

Create new User

Use the adduser command to add a new user to your system.

adduser ghostadmin

Update the password using the passwd command,

passwd ghostadmin

Use usermod command to add the user to the sudo group.

usermod -aG sudo ghostadmin

Use su command to switch to the new user account.

su - ghostadmin

We are using ghostadmin as a new user for Ghost. You can have any other name of your choice.

Install NGINX

sudo apt install nginx

Output:

hostadmin:
The following package was automatically installed and is no longer required:
  linux-image-6.12.33+deb13-amd64
Use 'sudo apt autoremove' to remove it.

Installing:
  nginx

Installing dependencies:
  nginx-common

Suggested packages:
  fcgiwrap  nginx-doc  ssl-cert

Summary:
  Upgrading: 0, Installing: 2, Removing: 0, Not Upgrading: 0
  Download size: 718 kB
  Space needed: 1,891 kB / 18.2 GB available

Install Database Server

Install a database server for Ghost CMS. This can either be MySQL or MariaDB database server.

In this example, we will choose MariaDB, which is a popular database server. The installation is simple and requires just a few steps as shown below,

sudo apt install mariadb-server

Output:

sudo apt install mariadb-server
The following package was automatically installed and is no longer required:
  linux-image-6.12.33+deb13-amd64
Use 'sudo apt autoremove' to remove it.

Installing:
  mariadb-server

Installing dependencies:
  galera-4                    libmariadb3
  gawk                        libncurses6
  libcgi-fast-perl            libpcre2-posix3
  libcgi-pm-perl              libsigsegv2
  libclone-perl               libsnappy1v5
  libconfig-inifiles-perl     libterm-readkey-perl
  libdbd-mariadb-perl         libtimedate-perl
  libdbi-perl                 liburi-perl
  libencode-locale-perl       mariadb-client
  libfcgi-bin                 mariadb-client-core
  libfcgi-perl                mariadb-common
  libfcgi0t64                 mariadb-plugin-provider-bzip2
  libgpm2                     mariadb-plugin-provider-lz4
  libhtml-parser-perl         mariadb-plugin-provider-lzma
  libhtml-tagset-perl         mariadb-plugin-provider-lzo
  libhtml-template-perl       mariadb-plugin-provider-snappy
  libhttp-date-perl           mariadb-server-core
  libhttp-message-perl        mysql-common
  libio-compress-brotli-perl  psmisc
  libio-html-perl             pv
  liblwp-mediatypes-perl      rsync
  liblzo2-2                   socat

Suggested packages:
  gawk-doc               libipc-sharedcache-perl  mariadb-test
  libmldbm-perl          libbusiness-isbn-perl    netcat-openbsd
  libnet-daemon-perl     libmime-base32-perl      doc-base
  libsql-statement-perl  libregexp-ipv6-perl      python3-braceexpand
  gpm                    libwww-perl
  libdata-dump-perl      mailx

Summary:
  Upgrading: 0, Installing: 45, Removing: 0, Not Upgrading: 0
  Download size: 21.2 MB
  Space needed: 204 MB / 18.1 GB available

When the installation is completed, Create the database user for the ghost blog.

sudo mysql

Then run:

ALTER USER root@localhost IDENTIFIED BY 'StrongPassword';
QUIT;

Replace StrongPassword with a better one.

Once the installation is complete, enable MariaDB (to start automatically upon system boot), start the MariaDB, and verify the status using the commands below.

sudo service mysql start

sudo service mysql restart

sudo service mysql status

Output:

ghostadmin@server:~$ sudo service mysql start

sudo service mysql restart

sudo service mysql status
● mariadb.service - MariaDB 11.8.2 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: >
     Active: active (running) since Fri 2025-08-01 15:13:44 EDT; 90ms ago
 Invocation: c93a74fb89e249b0b4efd2ee5d0b38b1
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 12320 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /va>
    Process: 12322 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] &&>
    Process: 12388 ExecStartPost=/bin/rm -f /run/mysqld/wsrep-start-position (c>
    Process: 12390 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0>
   Main PID: 12375 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 20 (limit: 46545)
     Memory: 125.9M (peak: 126.1M)
        CPU: 1.361s
     CGroup: /system.slice/mariadb.service
             ├─12375 /usr/sbin/mariadbd
             ├─12391 /bin/bash /etc/mysql/debian-start
             ├─12393 /usr/bin/mariadb-upgrade --defaults-extra-file=/etc/mysql/>
             ├─12394 grep -E -v "^(1|@had|ERROR (1051|1054|1060|1061|1146|1347|>
             ├─12395 logger -p daemon warn -i -t/etc/mysql/debian-start
             ├─12400 sh -c -- "'/usr/bin/mariadb' --defaults-file=/tmp/mysql_up>
             └─12401 /usr/bin/mariadb --defaults-file=/tmp/mysql_upgrade-4DJEqu>
lines 1-23

Install Latest Version of Node.js

sudo apt install curl

Output:

sudo apt install curl
The following package was automatically installed and is no longer required:
  linux-image-6.12.33+deb13-amd64
Use 'sudo apt autoremove' to remove it.

Installing:
  curl

Installing dependencies:
  libcurl4t64     libldap2      librtmp1    libsasl2-modules     libssh2-1t64
  libldap-common  libnghttp3-9  libsasl2-2  libsasl2-modules-db

Suggested packages:
  libsasl2-modules-gssapi-mit        libsasl2-modules-otp
  | libsasl2-modules-gssapi-heimdal  libsasl2-modules-sql
  libsasl2-modules-ldap

Summary:
  Upgrading: 0, Installing: 10, Removing: 0, Not Upgrading: 0
  Download size: 1,404 kB
  Space needed: 3,554 kB / 17.8 GB available
sudo curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -

Output:

 sudo curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
2025-08-06 14:53:41 - Installing pre-requisites
Hit:1 http://deb.debian.org/debian trixie InRelease
Hit:2 http://deb.debian.org/debian trixie-updates InRelease
Hit:3 http://security.debian.org/debian-security trixie-security InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ca-certificates is already the newest version (20250419).
curl is already the newest version (8.14.1-2).
The following package was automatically installed and is no longer required:
  linux-image-6.12.33+deb13-amd64
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  dirmngr gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpgconf gpgsm
  gpgv libassuan9 libgcrypt20 libgpg-error-l10n libgpg-error0 libksba8
  libnpth0t64 pinentry-curses
Suggested packages:
  pinentry-gnome3 tor gpg-wks-server parcimonie xloadimage scdaemon tpm2daemon
  rng-tools pinentry-doc
The following NEW packages will be installed:
  apt-transport-https dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent
  gpg-wks-client gpgconf gpgsm gpgv libassuan9 libgcrypt20 libgpg-error-l10n
  libgpg-error0 libksba8 libnpth0t64 pinentry-curses
0 upgraded, 18 newly installed, 0 to remove and 0 not upgraded.

Output:

 sudo curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
2025-08-06 14:53:41 - Installing pre-requisites
Hit:1 http://deb.debian.org/debian trixie InRelease
Hit:2 http://deb.debian.org/debian trixie-updates InRelease
Hit:3 http://security.debian.org/debian-security trixie-security InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ca-certificates is already the newest version (20250419).
curl is already the newest version (8.14.1-2).
The following package was automatically installed and is no longer required:
  linux-image-6.12.33+deb13-amd64
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  dirmngr gnupg-l10n gnupg-utils gpg gpg-agent gpg-wks-client gpgconf gpgsm
  gpgv libassuan9 libgcrypt20 libgpg-error-l10n libgpg-error0 libksba8
  libnpth0t64 pinentry-curses
Suggested packages:
  pinentry-gnome3 tor gpg-wks-server parcimonie xloadimage scdaemon tpm2daemon
  rng-tools pinentry-doc
The following NEW packages will be installed:
  apt-transport-https dirmngr gnupg gnupg-l10n gnupg-utils gpg gpg-agent
  gpg-wks-client gpgconf gpgsm gpgv libassuan9 libgcrypt20 libgpg-error-l10n
  libgpg-error0 libksba8 libnpth0t64 pinentry-curses
0 upgraded, 18 newly installed, 0 to remove and 0 not upgraded.
sudo apt install nodejs

Output:

ghostadmin@server:~$ sudo apt install nodejs
The following package was automatically installed and is no longer required:
  linux-image-6.12.33+deb13-amd64
Use 'sudo apt autoremove' to remove it.

Installing:
  nodejs

Summary:
  Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 0
  Download size: 32.0 MB
  Space needed: 199 MB / 17.8 GB available

Get:1 https://deb.nodesource.com/node_20.x nodistro/main amd64 nodejs amd64 20.19.4-1nodesource1 [32.0 MB]
Fetched 32.0 MB in 1s (23.1 MB/s)
Selecting previously unselected package nodejs.
(Reading database ... 50054 files and directories currently installed.)
Preparing to unpack .../nodejs_20.19.4-1nodesource1_amd64.deb ...
Unpacking nodejs (20.19.4-1nodesource1) ...
Setting up nodejs (20.19.4-1nodesource1) ...
Processing triggers for man-db (2.13.1-1) ...

Install Ghost-CLI

Ghost-CLI is a command-line interface (CLI) tool that makes installing and updating Ghost easy.

Install Ghost-CLI by running the below command,

sudo npm install -g ghost-cli@latest

Output:

sudo npm install -g ghost-cli@latest
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported

added 634 packages in 2m

167 packages are looking for funding
  run `npm fund` for details
npm notice
npm notice New major version of npm available! 10.8.2 -> 11.5.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.5.2
npm notice To update run: npm install -g npm@11.5.2
npm notice

Setting File Permissions

Replace example.com with your actual domain name.

Create the document root directory for Ghost.

sudo mkdir -p /var/www/example.com

Change ownership and permission of the /var/www/example.com.

sudo chown ghostadmin:ghostadmin /var/www/example.com
sudo chmod 775 /var/www/example.com

Install Ghost

Enter to the example.com root directory:

cd /var/www/example.com

Ensure that the directory is empty.

Let us now install Ghost on the directory by running the below command,

ghost install

Output:

✔ Checking system Node.js version - found v20.x.x
✔ Checking logged in user
✔ Checking current folder permissions
✔ Checking memory availability
✔ Checking free space
✔ Checking for latest Ghost version
✔ Setting up install directory
✔ Downloading and installing Ghost v5.x.x
✔ Finishing install process
? Enter your blog URL: http://example.com
? Enter your MySQL hostname: localhost
? Enter your MySQL username: ghost
? Enter your MySQL password: [hidden]
? Enter your Ghost database name: ghost
✔ Configuring Ghost
✔ Setting up instance
✔ Setting up "ghost" system user
✔ Setting up Nginx
✔ Setting up SSL
✔ Setting up Systemd
✔ Starting Ghost

Access Ghost CMS Dashboard

To complete the setup of your publication, visit:
http://example.com/ghost

Replace example.com with your actual domain.

Create your first Ghost administrator/publisher account by clicking on “Create your account”.

image

image

Invite other members.

You’ll get to the Ghost CMS dashboard in a few seconds.

Done.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS