Lets Get Started

Firstly install the latest Ubuntu distro (Download from here: https://www.ubuntu.com/download/server )

Once installed Lets create some shares

The below will create some generic locations for us to store data for the various containers we are going to deploy.

cd / 
sudo mkdir /shares/tv
sudo mkdir /shares/movies
sudo mkdir /shares/transcode
sudo mkdir /shares/music
sudo mkdir /docker/

Setting up Samba and file sharing for your network

sudo nano /etc/samba/smb.conf

Edit the file to include:

comment = shares
path = /shares/
browsable = yes
guest ok = yes
read only = no
create mask = 0777

Now press

'ctrl' + 'x' 
type 'y' 
to accept the changes.

lets now just ensure guest access to the shares on your network will be available:
sudo chmod -R 777 /shares/

Please ensure to understand file access permissions and the risks that come with it. Yes I'm aware this give the greatest level of access to these folders, if its secure data you might not want to do this.

Installing Docker

Copy and paste the below into your Ubuntu terminal

sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo app-get-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install docker-ce
sudo systemctl status docker

 Setting Up Portainer

Lets start deploying our first container. I will be showing you how to deploy Portainer first as this will allow you to easily manage your Docker host so lets start there:
sudo docker create --name portainer \
--restart=always \
--net=bridge \
-e PGID=1001 -e PUID=1001 \
-v /docker/portainer/config:/config \
-v /var/run/docker.sock:/var/run/docker.sock \
-p 9000:9000 \

Setting Up MYSQL

We will add MySQL so it can be the backend database for Wordpress

sudo docker create \
--name=mysql \
--restart=always \
-v /docker/mysql:/config \
-e TZ=Europe/London \
-e PGID=1001 -e PUID=1001 \
-p 3306:3306 \

Setting Up PHPMyAdmin

This will allow you to easily administer your MySQL if ever needed:

sudo docker create \
--name=phpmyadmin \
--restart=always \
-v /docker/phpmyadmin:/config \
-e TZ=Europe/London \
--link mysql:db \
-e PGID=1001 -e PUID=1001 \
-p 8080:80 \

Setting Up Plex

Plex will allow you to share and stream movies, music, TV shows across your network and on the internet.

sudo docker create \
--name=plex \
--hostname=changeme.com \
--net=host \
--restart=always \
-e VERSION=latest \
-e PUID=1001 -e PGID=1001 \
-e TZ=Europe/London \
-v /docker/plex/config:/config \
-v /shares/:/shares/ \

Installing LetsEncrypt

LetsEncrypt will allow you to host your own webserver and generate free SSL certifcates. Not you will need to provide your own domain name and details below:

sudo docker create \
--name=letsencrypt \
--restart=always \
-v /docker/nginx:/config \
-e VALIDATION=http,tls-sni,dns \
-e PGID=1001 -e PUID=1001 \
-e EMAIL=email@email.com \
-e URL=url.com \
-e SUBDOMAINS=cloud,www,mail,plex \
-p 80:80 -p 443:443 \
-e TZ=Europe/London \

Installing PosteIO

PosteIO will allow you to host your own email server

sudo docker create \
--name=posteIO \
--restart=always \
-p 25:25 \
-p 82:80 \
-p 110:110 \
-p 143:143 \
-p 442:443 \
-p 465:465 \
-p 587:587 \
-p 993:993 \
-p 995:995 \
-e PUID=1001 -e PGID=1001 \
-e TZ=Europe/London \
-v /docker/posteIO:/data \

Installing NextCloud

NextCloud allows you to share your files across all of your devices in your LAN and via the internet:

sudo docker create \
--name nextcloud \
-p 9443:443 \
-e PUID=1001 -e PGID=1001 \
-v /docker/nextcloud/config:/config \
-v /docker/nextcloud/data:/data \

Thats it!

You will now be able to access all these new containers by going into your internet browser and typing http://youServerIPAddress:portnumber and start messing with them.


Author - Matt Shore
Matt likes to play around with various technology to see how it works. He has various interest from Containers, IT Security, multimedia editing, and coding at an amateur level.