Installing Simple NixOS Mailserver on Fedora Server

In this tutorial, we will be going over the steps to install Simple NixOS Mailserver on Fedora Server. Simple NixOS Mailserver is a mailserver that is simple to set up and manage, uses only free and open-source software, and provides secure and reliable email service.

Prerequisites

  1. A Fedora Server Latest installed on your machine.
  2. Root or sudo user access to the server.
  3. A domain name pointed to your server's ip address.

Installing Simple NixOS Mailserver

  1. First, update the package lists.

    sudo dnf update
    
  2. Next, install the git and curl packages:

    sudo dnf install git curl
    
  3. Then, clone the Simple NixOS Mailserver repository:

    git clone https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git
    
  4. Change directory to the cloned repository:

    cd nixos-mailserver
    
  5. Run the following command to install Nix:

    curl https://nixos.org/nix/install | sh
    
  6. Once Nix is installed, run the following command to build the Simple NixOS Mailserver configuration:

    nix-shell -p nixpkgs-review --run "nix-build release.nix -A build.x86_64-linux"
    
  7. After the build is complete, deploy Simple NixOS Mailserver configuration by copying the result symlink to /etc/nixos/configuration.nix:

    sudo cp -r result/* /etc/nixos/
    
  8. Finally, run the following command to rebuild and activate the new configuration:

    sudo nixos-rebuild switch
    

Configuring Simple NixOS Mailserver

  1. Open the /etc/nixos/configuration.nix file in your favorite text editor.

    sudo nano /etc/nixos/configuration.nix
    
  2. Modify the sample configuration to match your own domain:

    { config, pkgs, ... }:
    
    {
      imports =
        [
          ./services/mailserver.nix
        ];
    
      mailserver =
        {
        hostname = "<your-domain.tld>";
        };
    }
    
  3. Save the file and exit.

  4. Rebuild and activate the new configuration:

    sudo nixos-rebuild switch
    

Summary

That's it. You've successfully installed Simple NixOS Mailserver on your Fedora Server and configured your domain. Now you can go ahead and create email accounts, aliases, and update the DNS records for your domain so that you can start sending and receiving email.

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!