Ubuntu mail

sudo apt-get update
sudo apt-get install postfix

sudo nano /etc/postfix/main.cf

remove the alias_maps parameter and replace it with virtual_alias_maps!!

virtual_alias_maps = hash:/etc/postfix/virtual

sudo nano /etc/postfix/virtual

@example.com yourusername

sudo service postfix restart

sudo apt-get install mailutils

How To Install and Setup Postfix on Ubuntu 14.04 : https://www.digitalocean.com/community/tutorials/how-to-install-and-setup-postfix-on-ubuntu-14-04

How To Install and Configure Postfix on Ubuntu 16.04 : https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-postfix-on-ubuntu-16-04

Setup mail server on ubuntu 14.04 ( Postfix – dovecot ) : http://www.krizna.com/ubuntu/setup-mail-server-ubuntu-14-04/

PostfixBasicSetupHowto : https://help.ubuntu.com/community/PostfixBasicSetupHowto

GNU Mailutils : http://mailutils.org/manual/html_node/Reading-Mail.html

firewall!!! sudo ufw allow Postfix


Mail forward:

virtual_alias_maps = hash:/etc/postfix/virtual

To catch and forward emails to any address for a given domain, use the following notation

@mydomain.com myself@gmail.com mystaff@gmail.com

Configure a Postfix Relay through Gmail on Ubuntu : https://devops.profitbricks.com/tutorials/configure-a-postfix-relay-through-gmail-on-ubuntu/

Configure Postfix to use Gmail as a Mail Relay 2016: https://www.howtoforge.com/tutorial/configure-postfix-to-use-gmail-as-a-mail-relay/

PhpMyAdmin not working after PHP 7 update in Ubuntu

How To Install and Secure phpMyAdmin on Ubuntu 14.04 : https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-14-04

The mbstring extension is missing. – Solution:

sudo apt-get install libapache2-mod-php7.0
sudo apt-get install php7.0-mbstring

and then sudo service apache2 restart.


Ubuntu server firewall install and setting

How To Set Up a Firewall with UFW on Ubuntu 14.04?: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-14-04

Some UFW command:

sudo apt-get install ufw [install]

sudo ufw default deny incoming
sudo ufw default allow outgoing

sudo ufw allow ssh
sudo ufw allow 22 [or your ssh port]

sudo ufw allow http
sudo ufw allow https

sudo ufw allow [port for your web admin!]

sudo ufw allow ftp
sudo ufw deny ftp

sudo ufw allow 22
sudo ufw deny 22

sudo ufw disable

sudo ufw status verbose

sudo ufw enable

Free Ubuntu disk space – What’s eating my disk space?

sudo apt-get clean

sudo apt-get autoremove

sudo apt-get install deborphan

sudo deborphan | xargs sudo apt-get -y remove –purge (2 line)

sudo reboot (or from VNC console)



The command du “summarizes disk usage of each FILE, recursively for directories:
du -hs /path/to/directory

Find the top 10 largest files and directories on Ubuntu:
sudo du -a / | sort -n -r | head -n 10


What’s eating my disk space?

should tell you where the space is consumed: sudo du -x -d1 -h /


Cleaning up Ubuntu 14.10,14.04,13.10 system : http://www.ubuntugeek.com/cleaning-up-a-ubuntu-gnulinux-system-updated-with-ubuntu-14-10-and-more-tools-added.html


Remove “orphaned” packages

If you want to remove orphaned packages you need to install deborphan package.

Install deborphan in Ubuntu

sudo apt-get install deborphan

Using deborphan

Open Your terminal and enter the following command

sudo deborphan | xargs sudo apt-get -y remove –purge


sudo apt-get autoremove