Certdog Linux Installation

From version: 1.18.0. For earlier versions see Debian Installation and Red Hat Installation

The Linux installer, configure.sh, works like the Windows one: it checks the system before changing anything, asks for the few details it needs, shows a summary to confirm, and then installs Certdog in five numbered steps. It sets up the database (MongoDB) with TLS, a replica set and access control, downloads Java, and starts Certdog.

For Docker see Get the Docker Image.

Before you start

Operating system

Any 64-bit (x86-64 or ARM64) Linux that MongoDB 8 supports, for example:

  • Debian 12
  • Ubuntu 22.04 or 24.04
  • Red Hat Enterprise Linux, Rocky Linux or AlmaLinux 8 or 9

Required

  • MongoDB 7 or later (8 is recommended), installed from MongoDB’s own package repository (see below). You only install it: configure.sh configures and starts it
  • A user that can use sudo, to run Certdog (see A user for Certdog)
  • curl or wget, to download Java (unless you provide Java yourself)
  • 1 GB of free disk space for the installation, and 2 GB for the database (/var/lib/mongodb)
  • Free ports for the three services (you can choose others):
Service Default port on Linux On Windows
UI and API (HTTPS) 1443 443
EST (HTTPS) 8443 8443
CRLs and OCSP (HTTP) 1480 80

Only root can listen on ports below 1024, so Certdog uses 1443 and 1480 by default. To serve them on 443 and 80, forward those ports: see Ports.

1. Install MongoDB

Install the mongodb-org package (which includes mongod and mongosh) from MongoDB’s repository. Do not start or configure it: configure.sh does that.

Debian 12

sudo apt-get install -y gnupg curl
curl -fsSL https://pgp.mongodb.com/server-8.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor
echo "deb [ signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/debian bookworm/mongodb-org/8.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org

Ubuntu 24.04

sudo apt-get install -y gnupg curl
curl -fsSL https://pgp.mongodb.com/server-8.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org

(For Ubuntu 22.04, use jammy instead of noble.)

Red Hat, Rocky Linux and AlmaLinux

Create /etc/yum.repos.d/mongodb-org-8.0.repo:

[mongodb-org-8.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/8.0/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://pgp.mongodb.com/server-8.0.asc

then:

sudo dnf install -y mongodb-org

For other distributions, see MongoDB’s Install on Linux.

configure.sh writes /etc/mongod.conf, keeping the original as /etc/mongod.conf.before-certdog, and copies the database’s TLS key to /etc/mongodb-certdog. Use a MongoDB that nothing else uses

2. A user for Certdog

Certdog runs as the user that installs it. That user needs to be able to use sudo (to configure MongoDB); Certdog itself does not run as root. We recommend a user of its own, for example on Debian or Ubuntu:

sudo useradd -m -s /bin/bash certdog
sudo passwd certdog
sudo usermod -aG sudo certdog

On Red Hat, the group is wheel instead of sudo. Then log in, or su - certdog, as that user.

You can install as root, but then Certdog runs as root: the installer warns you ([ WARN ] Privileges) and carries on.

3. Extract the installer

Download certdog.tar.gz as described in Download Locations, and extract it where Certdog will be installed. For example, as the certdog user, in /opt:

sudo mkdir /opt/certdog && sudo chown certdog: /opt/certdog
tar -xzf certdog.tar.gz -C /opt

The folder’s path must not contain a space.

4. Run configure.sh

cd /opt/certdog/install
./configure.sh

After accepting the End User Licence Agreement, configure.sh checks the system. Nothing is changed until every check passes:

configure.sh checking the system

If a check fails, it says why and what to do, then stops with exit code 2. For example, when the database has already been configured for Certdog:

A failed check

See Installation Troubleshooting for each check.

The installation details

It then asks for:

  1. The database administrator’s password, for the database account certmanadmin. You will not need it day to day, but record it. It cannot contain @ or :
  2. The first Certdog administrator: a username, an email address and a password
  3. The address to listen on, from the list of this machine’s addresses, or 0.0.0.0 to listen on all of them
  4. The ports for the UI and API, EST, and CRLs and OCSP. Press Enter to accept each default
  5. AI assistant access (MCP): whether AI assistants may answer questions about your certificates. See Certdog AI (MCP). It can be enabled later with ./configure-mcp.sh

It checks the ports are free, and shows a summary to confirm:

The details asked for, and the summary

The installation

Type y, and it installs in five steps: Java, the database, Certdog’s configuration, AI assistant access, and starting Certdog. It then waits for Certdog to answer:

The installation steps

Step What it does
1. Java Downloads Java (Eclipse Temurin 25) to certdog/java and checks its SHA-256 hash, unless it is already there
2. Database Configures MongoDB with TLS, a replica set and access control, enables and starts mongod, and creates its accounts and the first administrator
3. Certdog configuration Writes Tomcat’s configuration and the start and stop scripts
4. AI assistant access Enables MCP, if you asked for it
5. Starting certdog Starts Certdog

The master password is in config/MASTERPASSWORD.txt, readable only by the Certdog user. It protects the keys and credentials Certdog stores: back it up somewhere secure. The database passwords are in config/pwd/DBPASSWORDS.txt.

5. Log in

Go to https://<this server>:1443/certdog. Your browser warns that the connection is not private until you give Certdog a trusted TLS certificate (see Configure Server SSL): click Advanced, then Continue.

The Certdog sign-in page

Sign in as the first administrator.

Then see Post Installation, in particular setting the System URL.

Installing unattended

With --unattended (and --accept-eula), configure.sh asks nothing, and anything not given takes its default:

./configure.sh --unattended --accept-eula --first-admin-email pki@example.com
Option Default with --unattended
--accept-eula Required with --unattended
--db-admin-password <password> Generated, and saved to config/pwd/DBPASSWORDS.txt
--first-admin-username <name> admin
--first-admin-email <email> certdog@example.com
--first-admin-password <password> password, which must be changed at first login
--listen-address <address> 0.0.0.0 (all addresses)
--port <port> 1443
--est-port <port> 8443
--http-port <port> 1480
--enable-mcp / --disable-mcp Not enabled
--java-home <folder> Java is downloaded to certdog/java
--no-start Certdog is started

An unattended installation needs sudo to work without a password (or run sudo -v first, in the same session). Run ./configure.sh --help for every option.

Exit codes

Code Meaning
0 Certdog is installed (and answering, unless --no-start)
1 The installation failed part way. The message says what to do before trying again (e.g. run ./reset-db.sh)
2 A check before installing failed. Nothing was changed
3 Certdog is installed but did not answer within 3 minutes of starting
4 The options were not valid, or the EULA was not accepted

Installing without internet access

Before running configure.sh, put a Java 25 runtime in certdog/java (so that certdog/java/bin/java exists), for example from the Eclipse Temurin 25 JDK or JRE tar.gz for Linux from Adoptium. Or give --java-home <folder> to use a Java 25 installed elsewhere. MongoDB must be installed from packages copied to the machine, or a local mirror of MongoDB’s repository.

Ports

To serve Certdog on the standard ports 443 and 80, forward them to 1443 and 1480.

With iptables (e.g. Debian, Ubuntu):

sudo iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 1443
sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 1480
sudo iptables -I INPUT -p tcp -m tcp --dport 443 -j ACCEPT
sudo iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
sudo apt-get install -y iptables-persistent
sudo netfilter-persistent save

With firewalld (e.g. Red Hat):

sudo firewall-cmd --permanent --add-forward-port=port=443:proto=tcp:toport=1443
sudo firewall-cmd --permanent --add-forward-port=port=80:proto=tcp:toport=1480
sudo firewall-cmd --permanent --add-port={443,80,8443,1443,1480}/tcp
sudo firewall-cmd --reload

Forwarding like this applies to connections from other machines. On the server itself, keep using https://127.0.0.1:1443/certdog

To see which ports are in use: sudo ss -tulpn.

Starting and stopping

configure.sh starts Certdog. Afterwards, as the Certdog user:

/opt/certdog/bin/start-certdog.sh
/opt/certdog/bin/shutdown-certdog.sh
  • start-certdog.sh starts Certdog in the background, logging to logs/start.log. It keeps running when you log out. It will not start a second Certdog while one is running
  • shutdown-certdog.sh waits up to 25 seconds for Certdog to stop (or the number of seconds given, e.g. shutdown-certdog.sh 60), then ends it and says so

The database, mongod, is a system service, enabled to start at boot.

Starting Certdog at boot

Certdog itself is not started at boot unless you set this up. With systemd, a unit such as this, in /etc/systemd/system/certdog.service, does it (adjust the paths and user to your installation):

[Unit]
Description=Krestfield Certdog
After=network-online.target mongod.service
Requires=mongod.service

[Service]
Type=simple
User=certdog
ExecStart=/opt/certdog/bin/start-certdog.sh --foreground
ExecStop=/opt/certdog/bin/shutdown-certdog.sh
TimeoutStopSec=40
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target
/opt/certdog/bin/shutdown-certdog.sh
sudo systemctl daemon-reload
sudo systemctl enable --now certdog

Then start and stop Certdog with sudo systemctl start certdog and sudo systemctl stop certdog, rather than the scripts, and see its output with journalctl -u certdog.

This unit is an example: test it on your distribution before relying on it

Configuring again

configure.sh will not configure a database, or an installation, that it has configured before. To start again, which deletes all of the database’s data:

cd /opt/certdog/install
./reset-db.sh
./configure.sh

Logs

Log What it holds
install/install_log.txt Everything configure.sh did (passwords are never logged)
logs/start.log Tomcat’s output when started with start-certdog.sh
logs/ Certdog’s own logs
/var/log/mongodb/mongod.log The database’s log

Tips

  • Use a user of its own. Running Certdog as a dedicated, non-root user limits what it can reach
  • Back up the master password (config/MASTERPASSWORD.txt) and the database passwords (config/pwd/DBPASSWORDS.txt) somewhere secure
  • Back up the database regularly: see Backup
  • Use the same ports everywhere. If you run several servers, give each the same ports, so the forwarding rules and load balancer settings are the same
  • Try it in a container first. docker run gives a working Certdog in a minute: see Get the Docker Image