How to Install SquirrelMail on an Ubuntu 18.04 VPS or Dedicated Server

SquirrelMail is a web-based email client that supplements desktop software for sending and retrieving emails from an SMTP (Simple Mail Transfer Protocol) and IMAP (Internet Message Access) Protocol.

SquirrelMail is written in PHP and works pretty well in an Apache server running on Ubuntu 18.04 VPS. It is a complete solution for managing emails in a multi-user environment.

For instance, if you have a domain name (e.g. and separate emails accounts for your employees, they can check and send emails from a browser through SquirrelMail.

In this guide, we focus on the steps for installing SquirrelMail on your Ubuntu 18.04 server

Special Note: you may want to inquire on email hosting options as well. Visit HostAdvice's Best email hosting services page for reviews, prices and features.


  • A domain name(e.g.
  • A fully working SMTP server(e.g. Postfix)
  • A fully working IMAP server (e.g. Dovecot)
  • A non root-user with sudo privileges
  • Apache web server

Step 1: Download the latest version of SquirrelMail

By the time of writing this guide, the latest version of squirrelmail was version 1.4.22. We need to download this using the ‘wget’ command.

First, cd to the ‘/tmp’ folder by typing the command below:

$ cd /tmp

Next, enter the command below to download SquirrelMail

$ wget

Step 2: Unzip the archive file and copy it to the root of your website

First, let us install the unzip tool on our Ubuntu 18.04 server:

$ sudo apt-get install unzip

Then, we need to unzip the SquirrelMail archive file using the command below:

$ sudo unzip

We then move the content of the ‘squirrelmail-webmail-1.4.22’ directory to the root of our website:

$ sudo mv squirrelmail-webmail-1.4.22/ /var/www/html/mail

Step 3: Set the right directory permissions

In order for Apache to be able to interact with SquirrelMail without read/write problems, we should set the right directory and file ownership permissions using the command below:

$ sudo chown -R www-data:www-data /var/www/html/mail

Step 4: Configure SquirrelMail

SquirrelMail has a default configuration file (‘config_default.php’). We need to copy this file to config.php using the command below:

$ sudo cp /var/www/html/mail/config/config_default.php  /var/www/html/mail/config/config.php

Next we need to edit the file using nano editor to make a few changes:

$ sudo nano /var/www/html/mail/config/config.php

We need to set the values below:

$domain = '';
$data_dir = '/var/www/html/mail/data/';
$attachment_dir = '/var/www/html/mail/attach/';

Remember to replace ‘’ with the domain name of your website. Once you are done, press CTRL + X, Y and Enter to save the changes

The data directory is created by default once you install SquirrelMail but we need to create the attachments directory using the command below:

$ sudo /var/www/html/mail/attach/

We can run the command below one more time to ensure the permissions are updated on the directory:

$ sudo chown -R www-data:www-data /var/www/html/mail

Step 5: Open SquirrelMail on your browser

You can visit your SquirrelMail application using the address ‘’. If the setup was completed without a problem, you should see this login page:

Then, just enter your username and password associated with your email account and you will be able to login to the SquirrelMail dashboard.

You can then send or check emails from that interface just like you would do from an email client like Ms Outlook or Thunderbird. SquirrelMail presents a simple, intuitive and a feature-rich interface for managing your emails.


Those are the basic steps that you need to install SquirrelMail on your Ubuntu 18.04 VPS. Remember, you can send and read emails with SquirrelMail client and since it is accessible via a web browser, it means you can check your emails on the go without having to login to your Ubuntu server. I hope you enjoyed reading the guide.

Check out these top 3 Email hosting services:

Was this article helpful?