Home Server Ubuntu Setup
| Copyright: | © 2025 VEXIT , Tomorow is today ® , www.vexit.com |
| Author: | Vex Tatarevic |
| Date Created: | 2025-09-18 |
| Date Updated: | 2025-09-18 |
Definitions
| Term | Definition |
|---|---|
| Server / Remote (machine) / Host | Ubuntu Linux server computer |
| PC / Local (machine) / Client | Your personal computer |
Example Data Used
We will use the following data for the examples.
You should replace the sample data with your own data.
| Company name | my-com |
| Personal USername on Server | my-user |
| Admin Username on Server | admin |
| Server name | my-server |
| Server IP | 192.168.1.105 |
| SSH Port | 22 |
| Website Domain Name | my-site.com |
| Host Name | my-site.com |
Install System
Prerequisites
- Ensure laptop/PC has minimum 25GB storage space
- Have USB flash drive (12GB or above recommended)
- Backup existing data if reinstalling on used device
Download Ubuntu Image
- Open browser
- Go to https://ubuntu.com/download/desktop
- Download latest Ubuntu Desktop ISO (24.04 LTS recommended)
- Save ISO to memorable location on your PC
Ref: Ubuntu.com - Download An Ubuntu Image
Create Bootable USB
- Download balenaEtcher for your current OS from https://www.balena.io/etcher/
- Install and run balenaEtcher
- Select downloaded Ubuntu ISO file
- Select your USB flash drive
- Click Flash! to write the image
Ref: Ubuntu.com - Create A Bootable Usb Stick
Boot from USB
- Insert USB drive into target laptop/PC
- Restart device
- Enter BIOS boot menu (usually F12, F2, F10, or ESC key)
- Select USB drive from boot menu
- Choose language when prompted
- Select accessibility options if needed
- Choose keyboard layout
- Connect to network (enables driver downloads)
- Click "Try Ubuntu" to test or "Install Ubuntu" to proceed
Ref: Ubuntu.com - Boot From Usb Flash Drive
Installation Setup
- Choose "Interactive installation"
- Select installation type:
- "Erase disk and install Ubuntu" for clean install
- Or choose alongside existing OS if dual-booting
- Check boxes for third-party software and media formats
- Configure disk partitioning as needed
Ref: Ubuntu.com - Installation Setup
User Setup
- Enter your name
- Choose computer name (appears on network)
- Create username and strong password
- Choose login options (automatic or password required)
Ref: Ubuntu.com - Create Your Login Details
Location and Installation
- Select your timezone/location
- Review installation summary
- Click "Install" to begin installation
- Wait for installation to complete
- Click "Restart Now" when prompted
- Remove USB drive when prompted
- Enter encryption password if set
Ref: Ubuntu.com - Choose Your Location
Start Using Terminal
After the installation you should be logged in as my-user into the Server machine.
-
Open Terminal : CTRL + ALT + T
-
You should see
-
Close Terminal - type command
exitto close the Terminal
IMPORTANT: From this point on we will ONLY use the Terminal to interact with the Server machine. Whenever you see a command in this document, you should type it into the Terminal. We will not explicitly tell you to do so. You should know that seeing a code block with a command means that you should type it into the Terminal.
Sudo Disable Password Prompt
To run priviledged commands we must type sudo before the commands. By default using sudo asks for password every 15 minutes.
- Run the following command to see how annoying it is. Cancel when it asks you for password by pressing CTRL + C
Disable sudo password prompt so that you don't have to type it ever again when you want to run a sudo command.
- Open sudoers file
- Look for the line starting with %sudo. It should look like this:
- Add keyword NOPASSWD and a column symbol before the last ALL. It should now look like this
- Save and close the file: CTRL + S CTRL + X
Update Upgrade Reboot
- Update system - this will update the list of available packages
- Upgrade system - this will upgrade all the packages to the latest version
- Restart
SSH - Remotely Connect to Server
Set Up SSH on Server (Remote) Machine
On Server machine:
- Install SSH server
- Print internal IP address of server machine
- You should see address like :
192.168.1.105 - Note the IP address for remote access
Connect to Server from PC (Local) Machine
-
Log into your local PC computer
-
Open Terminal
- Connect to Server using SSH with the server IP address you noted down earlier and your user name on the server
```bash
Are you sure you want to continue connecting (yes/no/[fingerprint])?
```
- Type yes and hit Enter
- You will be prompted for password.
- Type the password and hit Enter
- You will see the welcome message of the Server machine
You are now connected to the Server machine remotely and can run any commands as if you were sitting in front of it.
- Disconnect from Server: CTRL + D
FROM THIS POINT ON, YOU WILL ONLY CONNECT TO THE SERVER REMOTELY USING SSH VIA THE TERMINAL ON YOUR PC.
Enable root User
- SSH into Server as my-user
- Generate password
-
Copy the password
-
Enable "root" user
-
Paste the password and hit Enter
-
You should see prompt:
Retype new password: -
Paste the password and hit Enter again
NOTE: If you make a mistake, exit out of interactive mode by typing CTRL + D and try again.
IMPORTANT: Save the password somewhere safe. You will need it in the next section
NOTE: We will be using root user to set up the admin user. This is only temporary. We will disable the root user very soon.
-
Enable password-based login via SSH for root user - This is disabled by default in SSH config.
-
Open ssh config file
- Locate line starting withsshd_configfor editing#PermitRootLogin- Change its value toyes- Uncomment the line - remove the#from the start - It should now look like this:PermitRootLogin yes- Save and close the file: CTRL + S CTRL + X - Restart ssh service - Reload daemon - Verify status of ssh service - You should seeActive: active (running) -
Disconnect from Server
Create Admin Account
- SSH into Server as root
- Create admin user