Ferdinand is still early, and the self-hosting process should be considered experimental. We are working on improving the self-hosting experience, and we welcome your feedback.

Prerequisites

Before you start self-hosting Ferdinand, you need to have the following prerequisites:

Installation

  1. Clone the Ferdinand repository on your server:
git clone https://github.com/valyentdev/ferdinand.git
  1. Change directory to the cloned repository:
cd ferdinand
  1. Run the templ command to generate the views:
templ generate
  1. Create a .env file, by copying the .env.example file:
cp .env.example .env
  1. Edit the .env file to set the missing environment variables:
vim .env
  1. Copy the .env file to /var/ferdinand.env
sudo cp .env /var/ferdinand.env
  1. Run the SMTP service:

Make sure that the 465, 80, and 443 ports are open on your server.

Build the SMTP service binary, and move it to the /usr/local/bin directory:

go build -o /usr/local/bin/smtp ./cmd/smtp

Create a systemd service file for the SMTP service:

sudo cp ./zarf/smtp.service /etc/systemd/system/smtp.service

Start the SMTP service:

sudo systemctl start smtp
  1. Edit the Caddyfile, to set your domain name:
vim zarf/Caddyfile
  1. Run the docker compose command to start the web-related services:
docker compose -f ./zarf/docker-compose.yml up -d
  1. Access the dashboard at https://mail.<domain>.<tld>

  2. Optional: Create an API key in the dashboard, and use it to send forgot password emails.

Don’t forget to modify the .env file to set the correct values for the environment variables, and to restart the Docker services after making changes to the .env file.