This post may contain affiliate links. Affiliate links are special links which allow the destination website know that we sent that visit. Should you then sign up and/or purchase their product or service, we may get a commission. Learn more.
Great. You have your very own email server. Now, how do you send and receive emails from it?Sure, you could do things the boring way and just sign in with your device’s email client. But, what if your device doesn’t have a good email client, or it’s simply a terrible one? What if you don’t have room on your phone to download yet another app? Wouldn’t it be great to have a website where you could send and receive emails from? Well, there is an open source solution for you: RainLoop. RainLoop is by far my favorite self-hosted webmail application to use. It’s easy to install, easy to configure, and doesn’t look like crap on mobile browsers. I’d even go as far as say that it looks better than Gmail! Sure, you could just use Roundcube, which comes pre-installed with VestaCP, but what would be the fun in that?
Pretty much all you need to run RainLoop is a web server that has a modern version of PHP. You’ll also need shell access(not really, read the full tutorial to find the alternate way), but not root. So, if you’re on a shared hosting provider like Namecheap, you can still follow this guide(by using the restricted shell). By the way, if you are on a shared hosting provider, your auto-installer(e.g. Softaculous) may support RainLoop.
0. PHP, Web server, Domain, Email Server, etc.
This post assumes that you already have a web server with PHP, a domain name(MX records and all), an email server, all of which are properly configured. If you need a DIY way to do this, get a domain name from Namecheap, a VPS from DigitalOcean and use VestaCP to make everything as easy as possible. The most cost-effective route is to just get a domain name from Namecheap and use their shared hosting, which also configures everything for you.
1. Create the Virtual Host
Since this process is different for pretty much every server configuration, I can’t go into to much detail here. If you’re on cPanel, create a new subdomain, and then open a shell in the document root. The same goes for VestaCP, or most other control panels. If you’re doing everything 100% DIY and don’t believe in control panels, then figure out how to create a virtual host with your web server. For both NGINX and Apache, you can just modify the default configuration file. For all other web servers, well, the internet exists for a reason. Once you create a virtual host and document root, open up a shell and go to the document root. If you’re new to terminals, just run the following command:
If you’re on cPanel or VestaCP, your document root will be probably be in a folder called
public_html, which is in a folder named your domain/subdomain.
2. Get the ZIP file
The next thing you’ll need to do is download the ZIP file from RainLoop’s website. But first, check if your server has the
unzip command(just type
unzip and press enter; if there’s a command not found error, it doesn’t exist, otherwise, it does exist). Should the command be installed, then just run the following two commands:
# Get the file wget https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip # Extract the file unzip rainloop-community-latest.zip
If your server doesn’t have the
unzip command, then you’ll have to do things the harder way. Just download the file onto your computer, and unzip it there. Then, use an FTP client to move the files to the server. If you’re uncomfortable using the command line, then you can also use this way.
3. Configuring RainLoop
Replace “example.com” with your domain name for all instances.
After you’ve extracted all of the files into your document root, the hard part is done. All that’s left now is to configure RainLoop. Luckily, this is a fairly simple process, all of which is done via the admin panel. Just visit “example.com/?admin”, and log in with the username “admin”, and password “12345”.
After you’re logged in, just head over to the “Domains” tab. This is where we’ll configure your email domain.
Click “Add Domain”:
Finally, fill out your server information. Chances are, both servers are “mail.example.com”. You can leave all other settings the same. If these settings fail, then try “imap.example.com” for IMAP, and “smtp.example.com” for SMTP. If that doesn’t work, double check your DNS records.
Change the Admin Password
After you’re done adding your domain, it’s important to change the admin password. Since the default password is the same for all RainLoop installs, hackers will have an easy time hacking into your RainLoop settings if you don’t change it. That being said, even if they do hack it, your email account(s) should still be safe. The admin password and your email accounts are separate, so you should be fine. That being said, it’s probably worth the extra five seconds to ensure your install is as secure as possible. To do this, simply go into the “Security” tab, and fill out the section labeled “Admin Panel Access Credentials”:
Use Your Webmail Client
Congratulations! You now have a working and self-hosted email client. Just go to the home page, and log in as you would with any other email client. The log in page looks something like the following image, and is the standard home page.
Once you’re logged in, you’ll be greeted with an easy to use interface. On the left you’ll find all of your email folders. To the right of that will be a list of all the emails in whichever folder you’re in. The rightmost and biggest section is where emails will display if you click on one. It takes a little getting used to, but it’s not that bad. I even prefer it to the Gmail interface. If you think it actually is better than Gmail, you can actually log in with your Gmail credentials and manage your email that way. I haven’t done this because my Google account uses two factor authentication, so I can’t log in with RainLoop.
To send emails, just click the green “Send” button in the top left corner. The rest is pretty self-explanatory:
That’s it! If you have any problems, leave a comment and I’ll do my best to help.