This tutorial will guide you step-by-step in installing the Simple NixOS Mailserver on Fedora CoreOS Latest. The Simple NixOS Mailserver is a complete mail server stack that is built entirely with NixOS modules. It uses Postfix as a mail transfer agent (MTA), Dovecot as an IMAP/POP3 server, and Rspamd as a spam filter.
Before we start, you will need to make sure that you have the following:
The Simple NixOS Mailserver requires the Nix package manager to be installed. You can install it by running the following command:
sudo dnf install -y nix
To install the Simple NixOS Mailserver, you will first need to clone the repository which can be found at https://gitlab.com/simple-nixos-mailserver/nixos-mailserver
. You can do this by running the following command:
git clone https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
Before installing the Simple NixOS Mailserver, you need to configure it according to your requirements.
Navigate to the cloned nixos-mailserver
directory:
cd nixos-mailserver
Copy the config.sample.nix
to config.nix
by running the following command:
cp config.sample.nix config.nix
Edit the config.nix
file to update the following parameters as per your requirements:
global.domainName
: This should be set to your domain name.services.dovecot.virtualHosts
: This should be set to the subdomains of your domain name where you want to enable the email service.services.rspamd.password
: Set your desired password for the Rspamd web interface.users.<username>.password
: Set the password for the user account that will be used to manage the mail server.Now that you have configured the mailserver, you can install it by running the following command:
sudo nixos-rebuild switch -I nixpkgs=https://nixos.org/channels/nixos-unstable/nixexprs.tar.xz
This command will install the Simple NixOS Mailserver using the updated configuration that you have provided in the previous steps.
Note that the -I nixpkgs=
option specifies which Nixpkgs package should be used during the build process. Here we use an unstable version of the NixOS distribution.
Once the installation is complete, you can verify the configuration by checking the config.nix
file in the /etc/nixos
directory:
cat /etc/nixos/config.nix
If everything was configured properly, you should see the configuration file with your settings.
You can also verify that the mail server is running by accessing the web interface of Rspamd at http://<your-server-ip>:11334/
.
Congratulations! You have successfully installed the Simple NixOS Mailserver on your Fedora CoreOS Latest server. You can now start sending and receiving emails using your own server.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!