Disclaimer this is a long guide, you might want to drink coffee first
Used proxmox add additional notes into installing on other physical devices / vm
Downloading Ubuntu
We are not savages so we are gonna use the LTS version, feel free to use other versions as of the date of this writing the latest is Ubuntu Server 22.04.2 LTS
Go to this page
Click on the download button an ISO file will be downloaded for you.
Things to do when download is completed
- Link will be added here in the future after i write a specific guide using the following
- Bootable Flashdrive for physical installation
- VM using VMWare or VirtualBox
- Promox Instance
Installing Ubuntu Server
- Start the machine
- Boot into the installation medium
- Detailed steps and screens are provided below
First Screen
Select `*Try or Install Ubuntu Server` press `enter`Ubuntu Live Boot
Wait for the live boot to finish
Select Language
Select desired language, this is different from setting your locale
Installer Update
The installer will update itself, feel free to skip this part use the arrow keys to navigate to Continue without updating
and press enter
Selecting Keyboard Layout
Keyboard layout most of the keyboard that are in PH is English(US/QWERTY)
Ubuntu Selection
Select Ubuntu Server
Network Connection
As of this example my network is under 192.168.110.0/24
subnet, thats why my dhcp address in the screen is 192.168.110.85/24
yours might be 192.168.1.x/24
the most common subnets for home routers, if you dont know what you are doing skip the next part and just click done on this part, the next part is about manually asigning and ipv4 address.
Static IP Assignment
- Navigate to the ether port using arrow keys press
enter
then go toedit
- A new popup below will show you what
IPv4 Method
you want to use pressenter
, you are in this section so selectManual
- A new popup with the following labels
Subnet , Address, Gateway, Name servers, Search domains
- Subnet e.g
192.168.1.0/24
if you dont understand it click here - Address e.g
192.168.1.137
you can replace 137, you dont know what it is? click here - Gateway e.g
192.168.1.1
your router address, for more info click here - Name servers e.g
8.8.8.8
is google’s public dns1.1.1.1
is cloudflare enter multitple with comma8.8.8.8,8.8.8.4
or1.1.1.1,1.1.1.4
For reference here is what i entered while doing this guide
Network Setup Done
Setup Mirror
Mirror is where we download packages from a certain server when we do something like apt install neovim
if you are not using any vpn, the installer will detect and give us ph server as default
Storage
I will not dive deep into this but this is basically where you set your storage size and partition depending on what machine you are doing this from it will show the hardisk in your system in this demo i allocated 32gb
of storage space and i will use it all, in your case if you are on a physical machine partition it well or use the entire ssd there is also an encryption option its up to you wether you want the data of this system encrypted or not press enter
Storage Configuration
This screen shows you how ubuntu assigns 3 partitions, sizes will depend on your storage medium used for the installation.
partition 1
is for theBIOS/UEFI
grub1MB
partition 2
is for the/boot
2GB
partition 3
is where your system files and/home/yourusername
will be stored29.997GB
Finish storage setup
If you are fine with the default settings ubuntu installer did Confirm
and Continue
this will format your storage
medium.
Setup Profile
Fill up the following
Your name
e.gBruce Wayne
you can literally put anything hereServer name
e.gbat-server_73
this is how other machines recognize your machine aside from its MAC and IP addressesUsername
e.gbatman
this is important as you will use this to ssh e.gssh [email protected]
Password
e.giambatman
choose a secure password
Fill up Profile
Ubuntu Pro
Well if you can afford why not?
Open SSH
Install it as we are gonna use OpenSSH server to connect and do more with our server
Featured Snaps
In this screen we wont install anything as we will dockerize services like nextcloud
Install Complete
Now the wait begins as get a cup of coffee, depending on how old your installer is the update will take long, Reboot
after it is done!
Your first boot
First Boot
The machine is now ready to be hacked!
Connecting to our server
SSH Login
Open a terminal in your workstation and connect through ssh
depending on what username and ipaddress of your server is assuming that you are on the same network you can use this command to connect to the server ssh username@ipv4address
a password will be asked
Updating our server
First update
on your terminal update your server with the following commands these are 2 commands for just checking updates use sudo apt update
these updates and references the list of packages you have installed if a new version is released, sudo apt upgrade
upgrade all the packages
After entering the command you will be prompted with Y/n
if you want to upgrade enter Y
and enter
Depending on how heavy the update is and whether it affects services a screen will appear in your terminal like the one below
Installing Docker and Portainer
open your terminal copy paste the entire snippet and run it
Terminal Output
Checking docker installation
Additional docker commands to add you the $USER
so you dont need to sudo docker commands anymore
Installing Portainer
The following command does the following for us
- downloads the latest portainer image
- sets the container to restart always on failure
- exposes port 9000 for http where we can access our portainer web page later at
192.168.110.133:9000
- adds volumes for its dependencies
- check the docs if you want to deploy it on https port on 9443
After succesful installation we can now access the web page in your browser go to assignedIpv4:9000
replace ipv4 to whatever your dhcp server assigned to your server or whatever you set statically
Click live connect and you will be navigated to your local instance dashboard
Go to app templates and feel free to install any template you want a good example would be File Browser
i havent used it myself but basically you can navigate your server files and folders in through your web browser
Installing Postgres and PgAdmin4
Before proceeding we can check that on our docker ps
command portainer exists and is running well
No we can start installing PostgresSQL and PgAdmin4 there are 2 ways we can install The first option is below
First option
- Create a docker volume where postgres sql db file will be persisted
- Postgres Installation
- This downloads the postgres image from docker repository/registry
- Uses the volume we created earlier with
/data/db
location - Exposes the
5432
port, postgres defalt port, allows us to connect to postgres through192.168.110.133:5432
this address - Default username is
postgres
we set the password topostgres
feel free to replace it
- Install and run docker named pgadmin, replace
[email protected]
andsomethingsecret
with your email and desired password
- This downloads the dpage/pgadmin4 image from docker repository/registry
- Exposes the
8080
port, the default port is 80, but we can use that default http port for something else - We can access the web page through
192.168.110.8080
feel free to use other ports - replace
[email protected]
andsomethingsecret
with your email and desired password
- Connect them together
Additional optins on portainer settings we could have done it on the commands above but i want to show you how to use the portainer also
Navigate and login to your portainer web page e.g
192.168.110.133:9000
Live connect to your local instance check containers and you will see the following
if You cant see the Published Ports of the container we created you did something wrong!
Click on the container
postgres
and if you scroll down you will seeContainer details
On
RESTART_POLICIES
where the default is set tonone
change it toalways
Do the same thing with
pgadmin
container
Second Option
Docker compose
Create a docker-compose.yaml
anywhere in your home directory for me i store my docker-compose
files at composers
in the directory where you created your docker-compose.yaml
enter the following commands
Additional runtime dependencies needed
- build-essentials and cmake
- nvm(Node Version Manager)