DevOps has become an essential practice in modern software development and IT operations, with the cloud playing a significant role in enabling automation, scalability, and collaboration. However, cloud platforms often come with recurring costs and require an internet connection, which may not always be ideal for beginners or enthusiasts. Building your own personal setup provides an excellent alternative for learning DevOps concepts in a hands-on, cost-effective manner.
In this article, we’ll explore why a personal setup is valuable, what you need to set one up, and how to create your own DevOps practice setup without relying on the cloud. In the basic form of cloud computing, the main thing that makes the cloud different is accessing computing resources over the internet, so what if you could do the same on your PC without subscribing to a cloud provider.
Why Consider a Personal Setup Instead of the Cloud?
Advantages:
Cost Savings: No monthly subscription fees for cloud services. You can repurpose old hardware.
Offline Access: Learn and experiment even without an internet connection.
Privacy and Control: Complete ownership of your data and setup.
Hands-On Learning: Gain deeper insights into infrastructure, networking, and system administration by managing everything locally.
What you need to setup one
Essential Components of a Personal Setup
Hardware Requirements
PCs or Laptops: Ensure adequate RAM (8GB minimum), CPU (4 cores or more), and storage (SSD recommended).Software and Tools
Virtualization Tools:
VirtualBox for lightweight virtualization needs.
VMware Workstation is another software for managing virtual machines.
Operating Systems
Linux distributions such as Ubuntu Server, CentOS, or Debian for hosting services.
Networking Tools and remote connection tools
OpenVPN or OpenSSH for remote access on your personal setup
- Tools for DevOps Practice
Version Control: Git for managing code.
CI/CD Pipelines: Jenkins, GitLab CI, or GitHub Actions.
Configuration Management: Ansible, Chef, or Puppet.
Infrastructure as Code (IaC): Terraform for provisioning infrastructure.
Monitoring and Logging: Prometheus, Grafana, and ELK stack.
Containerization Platforms:
Docker for running and managing containers.
Kubernetes (K3s or MicroK8s) for orchestrating containerized applications.
Setting Up Your Personal Setup (the real deal)
Step 1: Define Your Goals
First things first, determine what you want to achieve with your personal setup. Common goals include:
Learning Linux system administration.
Hosting a website or web software locally.
Practicing containerization and orchestration with Docker and Kubernetes.
Building and deploying CI/CD pipelines.
Exploring networking concepts.
Step 2: Set Up the Setup
The setup here will be for a web software
Prepare the Hardware:
Choose a machine
Ensure adequate RAM (8GB minimum), CPU (4 cores or more), and storage
If you are on a windows enable virtualization from your BIOS
Install a hypervisor like VirtualBox.
Install any of the linux distros as base operating system on the hypervisor, there are 2 ways you can go about this.
a. Install from scratch
Use a stable Linux distribution from scratch such as Ubuntu Server or Debian.
Configure SSH for remote access.
b. Install via osboxes.org, which is what we will be doing. Preconfigured images are found here( I advise you go for this, since it is faster and you will be using it for practice)
Select the VM images dropdown
Click on virtual box images at the top, it will take you to page with a list of operating systems.
Go to https://www.osboxes.org/ and download your preferred linux distro.
Select ubuntu on the new page (choose the distro of your choice).
Download VirtualBox (VDI) image
I am downloading Ubuntu in this case.
The good thing about osboxes is that it is very fast to install
Download the your preferred version. I am downloading the 24.10 Oracular Oriole, and my hardware is a 64bit version (choose what matches your hardware)
Take note of the username and password in the info section
Save and extract the OS image to a folder.
On the virtual box interface, click on new, name your OS and select its type and version.
The folder is where my VMs are stored, you can use any foler of your choice.
Next allocate memory (RAM- 2 or 4GB) and processors(you can use 2), that will be available for the new virtual machine, then click next
Select "Use an existing virtual hard disk file" and browse to the folder that contains the extracted disk image. The disk must be present in this path must be present for the machine to work.
Your new virtual machine has been created.
Right click on the new OS and click on settings
You can reset the processor, storage you want to allocate to the virtual machine.
NETWORK
Go to network
Set the network to bridged adapter, this helps the virtual machine to get its own IP address as well as connect to the internet.
Start the VM to test, configure the settings as desired, and install anything you will need for the other machines as this will serve as the base for other machines, then shut it down after testing, to create clones.
the password is at info section of the osboxes website
Example tools you might need to install:
Docker and Kubernetes:
check if openssh is present
Install Docker for containerization.
Set up Kubernetes (K3s for lightweight clusters).
Ansible, Jenkins or GitLab CI for building and applications.
And many more softwares required
type ifconfig to check for the ip address
if 'ifconfig' is not installed, follow the installation process. use
sudo apt install net-tools
run ifconfig again
I blocked you from seeing my ip address
check if openssh is present
sudo systemctl status ssh
If not, follow the following commands to install:
sudo apt update
Install the OpenSSH server package with the following command:
sudo apt install openssh-server
Check the status of the SSH service to ensure it's installed and running:
sudo systemctl status ssh
Start the SSH service:
sudo systemctl start ssh
Enable the SSH service to start on boot:
sudo systemctl enable ssh
Check the status of the SSH service again to ensure it's installed and running:
sudo systemctl status ssh
if it does not work as shown, follow the steps from the ssh section again.
shutdown the machine.
If you are on a windows machine, you can use mobaxterm to test and connect your VM via ssh.
CLONE THE VIRTUAL MACHINES
Right click on the newly created virtual machine and click clone.
name the first clone, I am naming mine "client machine" because that is what I intend to use as my local PC.
Ensure Generate new MAC addresses for all network adapters is selected
Click on linked clone(it saves space), then select finish
Repeat the cloning process for main-server, target-server1, target-server2. You will have something like at the end.
Remember: Generate new MAC addresses for all network adapters is selected
Sample setup
Start the client-machine and the target-server1.
let's change the name of the virtual machines from 'osboxes' to a preferred name. I am using 'clientmachine and targetserver1.
sudo nano /etc/hostname
sudo nano /etc/hosts
restart the machine and see the hostname change
open target-server1 machine and repeat the same steps, if you are familiar with ssh, login with ssh.
your output should look like this
Restart the machine and see the hostname change.
Next, follow this step-by-step guide to create a basic HTML website, test it locally, and then host it on your server with Nginx:
If you are familiar with creating basic HTML site and setting up nginx server, you can skip this part
create a basic html page on your client and test it.
Create the project folder:
mkdir my-website
cd my-website
Create the HTML file: Create an index.html file in the my-website folder:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Page Title</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<h1>My Website</h1>
<p>A website created by me.</p>
</body
</html>
Enter firefox index.html
in the cli to view the website
- setup your server with this guide
- Access the server: Use SSH to access your server: you can access it directly since it is on your computer, but I advise you use ssh, so you learn how to get into a real cloud environment
ssh user@your-server-ip
- Update and install necessary packages:
Update the system:
sudo apt update && sudo apt upgrade -y
Install Nginx:
sudo apt install nginx -y
- Verify Nginx installation: Start Nginx:
sudo systemctl start nginx
Check the status:
sudo systemctl status nginx
Step 3: Upload Your Website to the Server
Copy files to the server:
Use scp to upload your website files:
Ensure you run this command from the client machine when
scp -r my-website/* user@your-server-ip:/home/user/my-website/
Move files to the Nginx directory:
SSH into the server and move the website files to the default Nginx web directory:
sudo mv /home/user/my-website/* /var/www/html/
Step 4: Configure Nginx for Your Website
Edit the Nginx configuration:
Open the Nginx configuration file:
sudo nano /etc/nginx/sites-available/default
Update the server block to look like this:
server {
listen 80;
server_name your-domain.com;
root /var/www/html;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
Test the Nginx configuration:
sudo nginx -t
Reload Nginx:
sudo systemctl reload nginx
Step 5: Verify the Website on the Server
Open your server’s IP address (e.g., http://your-server-ip) in a browser. You should see your website. Your server ip is the one that is shown when you use the ifconfig
command.
If you have a domain, point it to your server’s IP address by updating the domain’s DNS settings. After DNS propagation, you can access the site using your domain.
Take note that the IP that is being mapped to this domain must be consistent with the ip of your server at any point in time, so be sure to update the ip accordingly whenever there is a restart, shutdown of server or any event that can trigger a change in the ip of your server machine.
If you do not want to go through the stress of constantly updating the DNS on a global accessibility scale, you can simply limit the availability and change to your local client machine by updating its hosts files in the /etc/hosts
file
sudo nano /etc/hosts
Your output will be something like this
Run this system for other tools like ansible and kubernetes like you would have done on a cloud sever, using the main server and the target servers on local like you would on the cloud.
Top comments (0)