How to Install Excision Mail on FreeBSD Latest

Excision Mail is an open-source self-hosted email server developed for both individuals and organizations. It is designed to provide a fast, secure, and easy-to-use email service. In this tutorial, we will guide you through the process of installing Excision Mail on FreeBSD Latest.

Prerequisites

Before proceeding with the installation, there are a few prerequisites you need to meet:

Step 1: Install Required Dependencies

First, we need to install some required dependencies to run Excision Mail on FreeBSD. Run the following command to install them:

sudo pkg install -y mongodb mailscanner p5-Mail-SpamAssassin opendkim opendmarc dovecot mailcow-ui

Step 2: Install Excision Mail

Now, we will download Excision Mail from GitHub using the following command:

git clone https://github.com/Excision-Mail/Excision-Mail.git

You will need to navigate into the downloaded directory using the cd command:

cd Excision-Mail/

Next, we need to install the Excision Mail dependency using composer. Run the following command to install composer:

sudo pkg install -y php74 curl
sudo curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

Once installed, run the following command to install the required PHP packages:

sudo composer install --no-dev

Step 3: Configure Excision Mail

Excision Mail configuration files are found in the config directory. Copy the app.php.example file to app.php using the following command:

cd config
cp app.php.example app.php

Now, edit the app.php file and configure the settings as required. You can use the following command to open the file:

sudo nano app.php

Some important settings you need to configure include:

Step 4: Run the Server

Excision Mail server can be started using the following command:

php artisan serve

This command will start the server on port 8000 by default. You can access it by opening your web browser and navigating to http://your_ip_address:8000 or http://your_domain_name:8000.

Step 5: Set up the Proxy Server

It is recommended to setup a proxy server like Nginx or Apache to forward HTTP and HTTPS requests to the Excision Mail server running on port 8000. We will demonstrate how to set up Nginx as the proxy server.

First, we need to install Nginx:

sudo pkg install -y nginx

Next, we need to create a new Nginx configuration file:

sudo nano /usr/local/etc/nginx/nginx.conf

Paste the following configuration in the file:

user  nginx;
worker_processes  1;

error_log  /var/log/nginx/error.log debug;
pid        /run/nginx.pid;


events {
    worker_connections  1024;
}

http {
    access_log  /var/log/nginx/access.log;

    server {
        listen 80;
        server_name your_domain_name;

        location / {
            proxy_pass http://127.0.0.1:8000;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        location /socket.io {
            proxy_pass http://127.0.0.1:8000/socket.io;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
}

Save and close the file. Finally, restart Nginx to apply the changes:

sudo service nginx restart

Conclusion

With Excision Mail installed and configured, you can now set up email accounts and start using the server to send and receive emails. We hope this tutorial was helpful in guiding you through the installation process.

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!