Self-hosting
Self-host Ferdinand to have full control over your email sending.
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:
- A server running Debian 10 or later
- A domain name, with A, AAAA and MX records on
mail.<domain>.<tld>
pointing to your server - Docker and Docker Compose
- The Go programming language
- The Templ CLI
Installation
- Clone the Ferdinand repository on your server:
- Change directory to the cloned repository:
- Run the
templ
command to generate the views:
- Create a
.env
file, by copying the.env.example
file:
- Edit the
.env
file to set the missing environment variables:
- Copy the
.env
file to/var/ferdinand.env
- 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:
Create a systemd service file for the SMTP service:
Start the SMTP service:
- Edit the Caddyfile, to set your domain name:
- Run the
docker compose
command to start the web-related services:
-
Access the dashboard at
https://mail.<domain>.<tld>
-
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.