Basic Ubuntu and docker setup.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md

README.md

Ubuntu-VPS

Quick commands to setup a Ubuntu VPS with docker.

##Step 1: Create a new user with sudo privileges.

sudo groupadd admin
sudo groupadd docker
sudo usermod -a -G admin,docker <LOGIN>

##Step 1.5: (optional) Logout, login as username.

##Step 2: Update/upgrade.

sudo aptitude update
sudo aptitude upgrade -y

##Step 3: Install docker. Thanks to https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-getting-started

sudo aptitude install linux-image-extra-`uname -r` -y
sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb http://get.docker.io/ubuntu docker > main/etc/apt/sources.list.d/docker.list"
sudo aptitude update
sudo aptitude install lxc-docker -y

##Step 4: Enable UFW forwarding for docker. Just use sed. Working in Ubuntu 14.04.

sudo sed -i "s/DEFAULT_FORWARD_POLICY=\"\(DROP\|ACCEPT\)\"/DEFAULT_FORWARD_POLICY=\"ACCEPT\"/g" /etc/default/ufw

##Step 5: Enable UFW.

sudo ufw allow ssh
sudo ufw reload #Some images enable ufw by default, in that case juse reload settings  
sudo ufw enable

##Step 6: Enable fail2ban.

sudo aptitude install fail2ban -y
sudo cp /etc/fail2ban/jail.conf /etc/fail2ban/jail.local
#optional: sudo vi /etc/fail2ban/jail.conf
sudo service fail2ban restart

##Step 7: DNS Just update the A records at the host.

  1. First record: '' (blank) NAME field
  2. Second record: '*' NAME field
  3. Third record: 'www' NAME field