|
@@ -0,0 +1,87 @@
|
|
|
+ <!DOCTYPE html>
|
|
|
+ <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
|
|
|
+ <head>
|
|
|
+ <title>Running iRedMail E-Mail Server in Docker</title>
|
|
|
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta name="keywords" content="Linux,Debian,Ubuntu,Self-Hosted,Web Based,E-Mail,Email,E-Mail Server,SMTP,Home Lab,Home Lab Ideas,Browser Based,Install Guide,Web Based Tools,Administration,Free E-Mail Server,Free And Easy SMTP Server,Free,E-Mail Server For Linux,Free Software,How To Setup Free E-Mail Server On Linux,Local E-Mail,Mail Server,System Administrator,Self-Host,Self-hosted,RainLoop,IRedMail,Docker,Docker Made Easy,How To,Tutorial,i12bretro">
|
|
|
+ <meta name="author" content="i12bretro">
|
|
|
+ <meta name="description" content="Running iRedMail E-Mail Server in Docker">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
+ <meta name="revised" content="04/08/2022 04:58:45 AM" />
|
|
|
+ <link rel="icon" type="image/x-icon" href="includes/favicon.ico">
|
|
|
+ <script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
|
|
+ <script type="text/javascript" src="includes/js/steps.js"></script>
|
|
|
+ <link href="css/steps.css" rel="stylesheet" type="text/css" />
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <div id="gridContainer">
|
|
|
+ <div class="topMargin"></div>
|
|
|
+ <div id="listName" class="topMargin">
|
|
|
+ <h1>Running iRedMail E-Mail Server in Docker</h1>
|
|
|
+ </div>
|
|
|
+ <div></div>
|
|
|
+ <div id="content">
|
|
|
+ <h2>What is iRedMail?</h2>
|
|
|
+
|
|
|
+<blockquote>[iRedMail is a] full-featured, open source mail server solution for mainstream Linux/BSD distributions.<i> - <a href="https://github.com/iredmail/iRedMail" target="_blank">https://github.com/iredmail/iRedMail</a></i></blockquote>
|
|
|
+
|
|
|
+<h2>Installing Docker</h2>
|
|
|
+
|
|
|
+<ol>
|
|
|
+ <li>Log into the Linux host and run the following commands in a terminal window
|
|
|
+ <div class="codeBlock"># update software repositories<br />
|
|
|
+ sudo apt update<br />
|
|
|
+ # install prerequisites<br />
|
|
|
+ sudo apt install apt-transport-https ca-certificates curl software-properties-common gnupg-agent -y<br />
|
|
|
+ # add docker gpg key<br />
|
|
|
+ curl -fsSL https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)/gpg | sudo apt-key add -<br />
|
|
|
+ # add docker software repository<br />
|
|
|
+ sudo add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release) $(lsb_release -cs) stable"<br />
|
|
|
+ # install docker<br />
|
|
|
+ sudo apt install docker-ce docker-compose containerd.io -y<br />
|
|
|
+ # enable and start docker service<br />
|
|
|
+ sudo systemctl enable docker && sudo systemctl start docker<br />
|
|
|
+ # add the current user to the docker group<br />
|
|
|
+ sudo usermod -aG docker $USER<br />
|
|
|
+ # reauthenticate for the new group membership to take effect<br />
|
|
|
+ su - $USER</div>
|
|
|
+ </li>
|
|
|
+</ol>
|
|
|
+
|
|
|
+<h2>Running iRedMail Container</h2>
|
|
|
+
|
|
|
+<ol>
|
|
|
+ <li>Continue with the following commands in a terminal window
|
|
|
+ <div class="codeBlock"># create main working directory<br />
|
|
|
+ mkdir ~/docker/iRedMail -p<br />
|
|
|
+ # create required sub-directories<br />
|
|
|
+ mkdir ~/docker/iRedMail/data/{backup-mysql,clamav,custom,imapsieve_copy,mailboxes,mlmmj,mlmmj-archive,mysql,sa_rules,ssl,postfix_queue} -p<br />
|
|
|
+ # create config file<br />
|
|
|
+ touch ~/docker/iRedMail/iredmail-docker.conf<br />
|
|
|
+ # write hostname to config<br />
|
|
|
+ echo HOSTNAME=mail.i2bretro.net >> ~/docker/iRedMail/iredmail-docker.conf<br />
|
|
|
+ echo FIRST_MAIL_DOMAIN=i12bretro.net >> ~/docker/iRedMail/iredmail-docker.conf<br />
|
|
|
+ echo FIRST_MAIL_DOMAIN_ADMIN_PASSWORD=SomethingSecure >> ~/docker/iRedMail/iredmail-docker.conf<br />
|
|
|
+ echo MLMMJADMIN_API_TOKEN=$(openssl rand -base64 32) >> ~/docker/iRedMail/iredmail-docker.conf<br />
|
|
|
+ echo ROUNDCUBE_DES_KEY=$(openssl rand -base64 24) >> ~/docker/iRedMail/iredmail-docker.conf<br />
|
|
|
+ # output the conf file and verify the values<br />
|
|
|
+ cat ~/docker/iRedMail/iredmail-docker.conf<br />
|
|
|
+ # set owner of working directories<br />
|
|
|
+ sudo chown "$USER":"$USER" ~/docker -R<br />
|
|
|
+ # run the iRedMail container<br />
|
|
|
+ docker run -d --name iRedMail --env-file ~/docker/iRedMail/iredmail-docker.conf -p 80:80 -p 443:443 -p 110:110 -p 995:995 -p 143:143 -p 993:993 -p 25:25 -p 465:465 -p 587:587 -v ~/docker/iRedMail/data/backup-mysql:/var/vmail/backup/mysql -v ~/docker/iRedMail/data/mailboxes:/var/vmail/vmail1 -v ~/docker/iRedMail/data/mlmmj:/var/vmail/mlmmj -v ~/docker/iRedMail/data/mlmmj-archive:/var/vmail/mlmmj-archive -v ~/docker/iRedMail/data/imapsieve_copy:/var/vmail/imapsieve_copy -v ~/docker/iRedMail/data/custom:/opt/iredmail/custom -v ~/docker/iRedMail/data/ssl:/opt/iredmail/ssl -v ~/docker/iRedMail/data/mysql:/var/lib/mysql -v ~/docker/iRedMail/data/clamav:/var/lib/clamav -v ~/docker/iRedMail/data/sa_rules:/var/lib/spamassassin -v ~/docker/iRedMail/data/postfix_queue:/var/spool/postfix iredmail/mariadb:stable</div>
|
|
|
+ </li>
|
|
|
+ <li>Open a web browser and navigate to http://DNSorIP/iredadmin</li>
|
|
|
+ <li>Log in with postmaster@<first_mail_domain> (postmaster@i12bretro.net in this example) and FIRST_MAIL_DOMAIN_ADMIN_PASSWORD set in iredmail-docker.conf</first_mail_domain></li>
|
|
|
+ <li>Welcome to iRedMail</li>
|
|
|
+ <li>Open a new browser tab and navigate to http://DNSorIP to reach the RoundCube web mail interface</li>
|
|
|
+ <li>Again, login with postmaster@<first_mail_domain> and the FIRST_MAIL_DOMAIN_ADMIN_PASSWORD set in iredmail-docker.conf</first_mail_domain></li>
|
|
|
+</ol>
|
|
|
+
|
|
|
+<p>Documentation: <a href="https://github.com/iredmail/dockerized" target="_blank">https://github.com/iredmail/dockerized</a></p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </body>
|
|
|
+ </html>
|
|
|
+
|