<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sebastian Sojan on Medium]]></title>
        <description><![CDATA[Stories by Sebastian Sojan on Medium]]></description>
        <link>https://medium.com/@sebastian.sojan.official?source=rss-ce1f6cb5f57f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*tei8PksztGd8uS68</url>
            <title>Stories by Sebastian Sojan on Medium</title>
            <link>https://medium.com/@sebastian.sojan.official?source=rss-ce1f6cb5f57f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 03:55:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sebastian.sojan.official/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Ubuntu Container Administration Using Docker]]></title>
            <link>https://medium.com/@sebastian.sojan.official/ubuntu-container-administration-using-docker-d87dd912e767?source=rss-ce1f6cb5f57f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d87dd912e767</guid>
            <dc:creator><![CDATA[Sebastian Sojan]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 02:41:38 GMT</pubDate>
            <atom:updated>2026-11-17T02:41:38.100Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Docker is not just about running applications inside containers. It also provides a lightweight environment where system administrators and DevOps engineers can perform Linux administration tasks.</p><p>In real-world operations, support engineers sometimes need temporary Linux environments to troubleshoot issues, install diagnostic tools, manage users, and perform system-level operations.</p><p>As part of my hands-on DevOps learning journey, I completed <strong>Project 18: Ubuntu Container Administration</strong>.</p><p>The objective was to create an interactive Ubuntu container, perform basic Linux administration tasks, and verify whether all changes remained after stopping and restarting the container.</p><h3>1. Pulling the Ubuntu Docker Image</h3><p>The first step was downloading the official Ubuntu image from Docker Hub.</p><p>Command:</p><pre>docker pull ubuntu</pre><p>To verify the downloaded image:</p><pre>docker images</pre><p>This command displays all locally available Docker images, including their repository names, tags, image IDs, and sizes.</p><h3>2. Running Ubuntu in Interactive Mode</h3><p>Next, I created an Ubuntu container and accessed its Bash terminal.</p><p>Command:</p><pre>docker run -it --name ubuntu-admin ubuntu bash</pre><p>Understanding the command:</p><ul><li>docker run – Creates and starts a container.</li><li>-i – Keeps standard input open.</li><li>-t – Allocates a pseudo-terminal.</li><li>--name ubuntu-admin – Assigns a container name.</li><li>ubuntu – Specifies the Docker image.</li><li>bash – Starts the Bash shell.</li></ul><p>After executing the command, I entered the Ubuntu container as the root user.</p><p>The terminal prompt changed to something similar to:</p><pre>root@container-id:/#</pre><p>This confirmed that I was working inside the Docker container rather than my host Ubuntu environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*P_HKTwcm8pXFWEwVte5lLw.png" /></figure><h3>3. Creating a New Linux User</h3><p>The next task was creating a dedicated user for support operations.</p><p>I created a user named supportuser.</p><p>Command:</p><pre>useradd -m -s /bin/bash supportuser</pre><p>Explanation:</p><ul><li>useradd – Creates a new Linux user.</li><li>-m – Creates the user&#39;s home directory.</li><li>-s /bin/bash – Assigns Bash as the default shell.</li><li>supportuser – Specifies the username.</li></ul><p>To verify the newly created user:</p><pre>id supportuser</pre><p>The output displayed the user’s UID, GID, and group information.</p><p>I also verified the home directory:</p><pre>ls /home</pre><p>The output confirmed that the supportuser home directory had been created successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*P_HKTwcm8pXFWEwVte5lLw.png" /></figure><h3>4. Installing curl</h3><p>Curl is a command-line utility commonly used by developers and system administrators to communicate with web servers and APIs.</p><p>Before installing packages, I updated the Ubuntu package repository information.</p><pre>apt update</pre><p>Then I installed curl:</p><pre>apt install -y curl</pre><p>To verify the installation:</p><pre>curl --version</pre><p>The version information confirmed that curl was installed successfully.</p><h3>5. Installing Vim</h3><p>Next, I installed Vim, a popular command-line text editor used in Linux environments.</p><p>Command:</p><pre>apt install -y vim</pre><p>To verify:</p><pre>vim --version</pre><p>This displayed the installed Vim version and configuration information.</p><p>Both curl and Vim were now available inside the Ubuntu container.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*W2SDr7uod2g4N6Ej2_GBhQ.png" /></figure><h3>6. Creating a Directory</h3><p>For the support engineer’s troubleshooting activities, I created a dedicated directory.</p><p>Command:</p><pre>mkdir -p /opt/support-tools</pre><p>The /opt directory is commonly used for additional software and application-related files.</p><p>To verify the directory:</p><pre>ls -ld /opt/support-tools</pre><p>I also created a sample file:</p><pre>touch /opt/support-tools/notes.txt</pre><p>And verified it:</p><pre>ls -l /opt/support-tools</pre><p>The directory and sample file were successfully created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/893/1*FQPwPHFMzMMu9Bcl5OKKAA.png" /></figure><h3>7. Verifying Installed Packages</h3><p>Before exiting the container, I verified that both utilities were available.</p><p>Commands:</p><pre>which curl<br>which vim</pre><p>Expected output:</p><pre>/usr/bin/curl<br>/usr/bin/vim</pre><p>I also checked their version information to confirm successful installation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*W2SDr7uod2g4N6Ej2_GBhQ.png" /></figure><h3>8. Exiting the Container</h3><p>After completing the Linux administration tasks, I exited the interactive Ubuntu shell.</p><pre>exit</pre><p>This stopped the container because its main process was the interactive Bash shell.</p><p>To verify its status:</p><pre>docker ps -a</pre><p>Unlike docker ps, which displays running containers, docker ps -a also displays stopped containers.</p><p>The ubuntu-admin container appeared with the status:</p><pre>Exited</pre><p>Importantly, I did not remove the container.</p><h3>9. Restarting the Container</h3><p>Now came the most interesting part of the exercise.</p><p>I wanted to verify whether the previously created user, installed packages, and directory would remain available after restarting the container.</p><p>Instead of creating a new container, I restarted the existing one.</p><p>Command:</p><pre>docker start -ai ubuntu-admin</pre><p>Explanation:</p><ul><li>docker start – Starts an existing stopped container.</li><li>-a – Attaches the terminal.</li><li>-i – Keeps standard input open.</li></ul><p>After executing the command, I was back inside the same Ubuntu container.</p><h3>10. Verifying Persistence After Restart</h3><p>Finally, I checked whether all the previous changes remained available.</p><p><strong>Verify the created user:</strong></p><pre>id supportuser</pre><p><strong>Verify curl:</strong></p><pre>curl --version</pre><p><strong>Verify Vim:</strong></p><pre>vim --version</pre><p><strong>Verify the created directory:</strong></p><pre>ls -ld /opt/support-tools</pre><p><strong>Verify the sample file:</strong></p><pre>ls -l /opt/support-tools</pre><p>All the previously created resources and installed packages were still available.</p><p>This confirmed that the changes persisted after stopping and restarting the same container.</p><h3>Important Docker Concept: Container Persistence</h3><p>One of the most important concepts I learned from this exercise was how Docker handles container filesystems.</p><p>When we stop a Docker container, its writable filesystem is preserved.</p><p>When we restart the same container, the previously installed packages, created users, and directories remain available.</p><p>However, if we remove the container using docker rm, its writable filesystem is deleted unless the required data has been stored in a Docker volume or another persistent storage location.</p><p>This distinction is important when managing containers in development and production environments.</p><h3>Key Commands Learned</h3><p>CommandPurposedocker pull ubuntuDownloads the Ubuntu imagedocker run -itStarts an interactive containeruseraddCreates a Linux userapt updateUpdates package repository informationapt installInstalls Linux packagesmkdirCreates a directorytouchCreates an empty filewhichLocates an executabledocker ps -aLists all containersdocker start -aiRestarts and attaches to an existing container</p><h3>Conclusion</h3><p>This hands-on project helped me understand how Docker containers can be used for temporary Linux administration and troubleshooting activities.</p><p>I gained practical experience in:</p><ul><li>Deploying an Ubuntu container.</li><li>Managing Linux users.</li><li>Installing packages using APT.</li><li>Creating directories and files.</li><li>Accessing containers interactively.</li><li>Restarting stopped containers.</li><li>Verifying filesystem persistence.</li></ul><p>These are fundamental skills for anyone working in Linux administration, Cloud Engineering, or DevOps.</p><p>I am continuing to improve my practical knowledge of Docker, Linux, Kubernetes, AWS, and CI/CD through consistent hands-on projects.</p><p><strong>Learning by doing. Building practical skills. Growing as a Cloud/DevOps Engineer.</strong></p><p>#Docker #Ubuntu #LinuxAdministration #DevOps #Containerization #Linux #CloudComputing #AWS #DockerContainers #LearningInPublic</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d87dd912e767" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Container Health Check: Monitoring Nginx Container Health]]></title>
            <link>https://medium.com/@sebastian.sojan.official/docker-container-health-check-monitoring-nginx-container-health-89220aa2e375?source=rss-ce1f6cb5f57f------2</link>
            <guid isPermaLink="false">https://medium.com/p/89220aa2e375</guid>
            <dc:creator><![CDATA[Sebastian Sojan]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 02:08:25 GMT</pubDate>
            <atom:updated>2026-11-17T02:08:25.347Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In a production environment, running a container does not necessarily mean that the application inside it is working correctly.</p><p>A container might be running while its application is unresponsive, unavailable, or experiencing errors.</p><p>This is where <strong>Docker Health Checks</strong> become important.</p><p>As part of my hands-on DevOps learning journey, I completed Project 17: Container Health Check. The objective was to deploy an Nginx container, configure a health check, inspect its health status, and simulate an application failure to understand how Docker monitors container health.</p><h3>1. Running an Nginx Container</h3><p>I started by deploying an Nginx container using the official Docker image.</p><p>Command:</p><pre>docker run -d \<br>  --name nginx-health \<br>  -p 8080:80 \<br>  nginx</pre><p>Explanation:</p><ul><li>-d – Runs the container in detached mode.</li><li>--name nginx-health – Assigns a name to the container.</li><li>-p 8080:80 – Maps host port 8080 to container port 80.</li><li>nginx – Uses the official Nginx image.</li></ul><p>I verified the container using:</p><pre>docker ps</pre><p>I also accessed the application through:</p><pre>http://localhost:8080</pre><p>The default Nginx welcome page confirmed that the web server was responding.</p><h3>2. Configuring a Docker Health Check</h3><p>Next, I recreated the container with a Docker health check.</p><pre>docker rm -f nginx-health</pre><p>Then I started Nginx with the following configuration:</p><pre>docker run -d \<br>  --name nginx-health \<br>  -p 8080:80 \<br>  --health-cmd=&quot;curl -f http://localhost/ || exit 1&quot; \<br>  --health-interval=10s \<br>  --health-timeout=5s \<br>  --health-retries=3 \<br>  --health-start-period=5s \<br>  nginx</pre><h3>Understanding the Health Check Parameters</h3><p>ParameterDescription--health-cmdCommand Docker executes to check application health--health-intervalTime between health checks--health-timeoutMaximum time allowed for a health check--health-retriesConsecutive failures required to mark the container unhealthy--health-start-periodInitial grace period for application startup</p><p>I used curl -f to check whether the Nginx web server was responding successfully.</p><p>The -f option makes curl return a failure status for HTTP errors such as 404 and 500.</p><h3>3. Inspecting Container Health Status</h3><p>After configuring the health check, I waited for Docker to execute the health-check commands.</p><p>I verified the container using:</p><pre>docker ps</pre><p>The output showed:</p><pre>CONTAINER ID   IMAGE   STATUS<br>xxxxxxxx       nginx   Up About a minute (healthy)</pre><p>To check the health status directly, I used:</p><pre>docker inspect --format=&#39;{{.State.Health.Status}}&#39; nginx-health</pre><p>Output:</p><pre>healthy</pre><p>I also inspected detailed health information:</p><pre>docker inspect --format=&#39;{{json .State.Health}}&#39; nginx-health</pre><p>This provided information about health-check execution, including status, failing streak, execution timestamps, and command output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GzRz96HPRaPGo9SSbdIGZA.png" /></figure><h3>4. Troubleshooting the Health Check</h3><p>During this exercise, I encountered an interesting issue.</p><p>Initially, I configured the health check using:</p><pre>--health-cmd=&quot;wget -q --spider http://localhost/ || exit 1&quot;</pre><p>However, Docker continuously reported the container as unhealthy.</p><p>When I inspected the container, I found the following error:</p><pre>/bin/sh: 1: wget: not found</pre><p>The Nginx container was actually running correctly, but the health-check command was failing because wget was unavailable inside the container.</p><p>I investigated the available tools:</p><pre>docker exec nginx-health which curl</pre><p>Output:</p><pre>/usr/bin/curl</pre><p>I changed the health-check command from wget to curl:</p><pre>--health-cmd=&quot;curl -f http://localhost/ || exit 1&quot;</pre><p>After recreating the container, the health status changed to:</p><pre>healthy</pre><p>This troubleshooting experience helped me understand why health-check commands must use tools available inside the container.</p><h3>5. Simulating an Application Failure</h3><p>After successfully achieving the healthy state, I wanted to understand how Docker detects application failures.</p><p>Instead of stopping the Nginx process, I simulated an application-level failure by temporarily renaming the web root directory.</p><p>Command:</p><pre>docker exec nginx-health mv /usr/share/nginx/html /usr/share/nginx/html-backup</pre><p>This did not stop the Nginx process.</p><p>However, the default web page became unavailable, and Nginx started returning HTTP 404 responses.</p><p>Since my health check used:</p><pre>curl -f http://localhost/ || exit 1</pre><p>Docker detected the failed HTTP response.</p><p>After three consecutive failed health checks, Docker marked the container as:</p><pre>unhealthy</pre><p>I verified the status using:</p><pre>docker inspect --format=&#39;{{.State.Health.Status}}&#39; nginx-health</pre><p>Expected output:</p><pre>unhealthy</pre><p>The important observation was that the container could remain running even when its application was unhealthy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a_ZL1xAyB5NjJv8e0HBmRQ.png" /></figure><h3>6. Restoring the Application</h3><p>After completing the failure simulation, I restored the original web directory:</p><pre>docker exec nginx-health mv /usr/share/nginx/html-backup /usr/share/nginx/html</pre><p>After a few successful health checks, Docker changed the status back to:</p><pre>healthy</pre><p>This demonstrated how Docker continuously monitors application health.</p><h3>Key Docker Commands Learned</h3><p>CommandPurposedocker runCreates and starts a containerdocker psLists running containersdocker execExecutes commands inside a running containerdocker inspectDisplays detailed container informationdocker rmRemoves a containercurl -fChecks HTTP responses and reports HTTP errors</p><h3>Important DevOps Interview Concept</h3><p><strong>What is the difference between a running container and a healthy container?</strong></p><p>A running container indicates that its main process is executing.</p><p>A healthy container indicates that its configured health-check command is passing successfully.</p><p>For example:</p><ul><li>Running + Healthy: Nginx is running and responding successfully.</li><li>Running + Unhealthy: Nginx container is running, but the health check is failing.</li><li>Exited: The container’s main process has stopped.</li></ul><p>One important point is that Docker health checks do not automatically restart unhealthy containers. They report the health status so that monitoring systems or orchestration platforms can respond appropriately.</p><h3>Conclusion</h3><p>This project helped me understand how Docker monitors container health beyond simply checking whether a container is running.</p><p>I also gained practical troubleshooting experience by identifying a missing utility inside the container, correcting the health-check configuration, and simulating an application failure without stopping the container.</p><p>Health checks are an important part of building reliable containerized applications and are especially useful when working with Docker Compose, Kubernetes, and production deployment environments.</p><p>I am continuing to build my practical knowledge of Docker, Linux, Kubernetes, AWS, and CI/CD as part of my Cloud/DevOps engineering journey.</p><p><strong>Learning by doing, troubleshooting real problems, and improving one project at a time!</strong></p><p>#DevOps #Docker #DockerHealthCheck #Nginx #Containerization #Linux #AWS #Kubernetes #CloudComputing #LearningInPublic</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89220aa2e375" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Image Management: A Beginner’s Hands-on Guide]]></title>
            <link>https://medium.com/@sebastian.sojan.official/docker-image-management-a-beginners-hands-on-guide-f001127d7232?source=rss-ce1f6cb5f57f------2</link>
            <guid isPermaLink="false">https://medium.com/p/f001127d7232</guid>
            <dc:creator><![CDATA[Sebastian Sojan]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 01:22:30 GMT</pubDate>
            <atom:updated>2026-11-17T01:22:30.378Z</atom:updated>
            <content:encoded><![CDATA[<h3>Docker Image Management: Pull, List, Remove and Tag Docker Images</h3><h3>Introduction</h3><p>Docker is one of the most important tools in the DevOps ecosystem. It allows developers and DevOps engineers to package applications and their dependencies into containers, making them easier to build, deploy, and manage across different environments.</p><p>As part of my hands-on DevOps learning journey, I completed a practical exercise on <strong>Docker Image Management</strong>, focusing on pulling images, listing downloaded images, removing unused images, and tagging an existing image.</p><p>In this exercise, I worked with three popular Docker images: Ubuntu, Alpine, and Redis.</p><h3>1. Pulling Docker Images</h3><p>The first step was downloading the required images from Docker Hub.</p><p>I used the following commands:</p><p><strong>Pull Ubuntu:</strong></p><pre>docker pull ubuntu</pre><p><strong>Pull Alpine:</strong></p><pre>docker pull alpine</pre><p><strong>Pull Redis:</strong></p><pre>docker pull redis</pre><p>The docker pull command downloads an image from a container registry, such as Docker Hub, to the local machine.</p><p>These images can then be used to create and run containers.</p><h3>2. Listing Downloaded Docker Images</h3><p>After downloading all three images, I verified them using:</p><pre>docker images</pre><p>This command displays the Docker images available locally.</p><p>It provides information such as:</p><ul><li>Repository name</li><li>Image tag</li><li>Image ID</li><li>Creation date</li><li>Image size</li></ul><p>This is useful for checking which images are available before creating containers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IUXQfgW9tOT7xXoVd8qKWQ.png" /></figure><h3>3. Removing an Unused Docker Image</h3><p>Next, I removed the Alpine image as instructed in the exercise.</p><p>Command:</p><pre>docker rmi alpine</pre><p>The docker rmi command removes a Docker image from the local system.</p><p>After removing Alpine, I executed:</p><pre>docker images</pre><p>This helped me verify that the Alpine image was no longer listed.</p><p><strong>Why is image cleanup important?</strong></p><p>Over time, Docker environments can accumulate unused images. Removing unnecessary images helps free up disk space and keeps the local Docker environment organized.</p><p>Note: Docker may prevent image removal if containers still depend on it.</p><h3>4. Tagging the Ubuntu Image</h3><p>The next task was to create a new tag for the Ubuntu image.</p><p>I used:</p><pre>docker tag ubuntu:latest company-ubuntu:v1</pre><p>This command creates a new reference to the existing Ubuntu image.</p><p>Here is what the command means:</p><ul><li>docker tag – Creates a new image tag.</li><li>ubuntu:latest – The source image.</li><li>company-ubuntu:v1 – The new repository name and tag.</li></ul><p>Tagging is useful when managing images across different environments or preparing application images for deployment.</p><p>For example, organizations may use naming conventions such as:</p><ul><li>company-ubuntu:dev</li><li>company-ubuntu:test</li><li>company-ubuntu:v1</li><li>company-ubuntu:production</li></ul><h3>5. Verifying the New Docker Tag</h3><p>Finally, I verified the new tag using:</p><pre>docker images</pre><p>The output showed the new repository name:</p><pre>company-ubuntu    v1</pre><p>Both ubuntu:latest and company-ubuntu:v1 reference the same image ID.</p><p>This means Docker created another tag for the existing image rather than downloading or creating an entirely separate image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*_2F_5rEZ6NtvpybJMuSccA.png" /></figure><h3>Key Docker Commands Learned</h3><p>CommandPurposedocker pullDownloads an imagedocker imagesLists local imagesdocker rmiRemoves an imagedocker tagCreates a new image tag</p><h3>Conclusion</h3><p>This hands-on exercise helped me understand the fundamentals of Docker image management.</p><p>Although these are basic Docker commands, they are essential for everyday DevOps activities, including managing container images, cleaning up unused resources, and maintaining consistent image naming conventions.</p><p>I am continuing to strengthen my practical knowledge of Docker, Linux, Kubernetes, AWS, and CI/CD as part of my journey towards becoming a Cloud/DevOps Engineer.</p><p><strong>Learning by doing, one practical task at a time!</strong></p><p>#DevOps #Docker #DockerImageManagement #Linux #CloudComputing #AWS #Kubernetes #100DaysOfDevOps #LearningInPublic</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f001127d7232" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hosting My Sample Resume Website Using Nginx and a Custom Local Domain on Ubuntu]]></title>
            <link>https://medium.com/@sebastian.sojan.official/hosting-my-resume-website-using-nginx-and-a-custom-local-domain-on-ubuntu-28f2f4563a65?source=rss-ce1f6cb5f57f------2</link>
            <guid isPermaLink="false">https://medium.com/p/28f2f4563a65</guid>
            <dc:creator><![CDATA[Sebastian Sojan]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 21:13:17 GMT</pubDate>
            <atom:updated>2026-11-16T21:14:15.869Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>As part of my DevOps learning journey, I completed another hands-on project focused on web server configuration and website hosting using Nginx.</p><p>The objective of this project was to create a personal resume website, configure a custom local domain using my own name, and make the resume accessible through a web browser.</p><p>Instead of accessing the website using an IP address, I configured a custom domain:</p><p><a href="http://www.sebastian.local/"><strong>www.sebastian.local</strong></a></p><p>I used Ubuntu 26.04 LTS as my operating system and Nginx as my web server.</p><h3>Project Objectives</h3><p>The main tasks of this project were:</p><ul><li>Create a personal resume using HTML.</li><li>Install and configure Nginx.</li><li>Configure a custom local domain.</li><li>Create an Nginx virtual host.</li><li>Configure the Linux hosts file.</li><li>Access the resume using the custom domain.</li><li>Verify that the website works in a browser.</li></ul><h3>Technologies Used</h3><p>TechnologyPurposeUbuntu 26.04 LTSOperating systemNginxWeb serverHTMLResume website developmentLinux TerminalServer configurationHosts fileLocal domain name resolution</p><h3>Step 1: Creating the Resume Website</h3><p>First, I created a directory to store my resume website.</p><pre>sudo mkdir -p /var/www/sebastian-resume</pre><p>Then I created an HTML file:</p><pre>sudo nano /var/www/sebastian-resume/index.html</pre><p>I developed a simple personal resume website containing:</p><ul><li>Name and professional title.</li><li>Contact information.</li><li>Professional summary.</li><li>Technical skills.</li><li>DevOps projects.</li><li>Educational qualifications.</li><li>Career objective.</li></ul><p>The website was designed using HTML and CSS to provide a clean and professional appearance.</p><h3>Step 2: Configuring Nginx</h3><p>Next, I configured Nginx to host my resume website.</p><p>I created a new Nginx configuration file:</p><pre>sudo nano /etc/nginx/sites-available/sebastian-resume</pre><p>I added the following configuration:</p><pre>server {<br>    listen 80;</pre><pre>    server_name <a href="http://www.sebastian.local;/">www.sebastian.local;</a></pre><pre>    root /var/www/sebastian-resume;</pre><pre>    index index.html;</pre><pre>    location / {<br>        try_files $uri $uri/ =404;<br>    }<br>}</pre><p>This configuration tells Nginx to:</p><ul><li>Listen for HTTP requests on port 80.</li><li>Respond to requests for <a href="http://www.sebastian.local/">www.sebastian.local</a>.</li><li>Serve website files from /var/www/sebastian-resume.</li><li>Load index.html as the default page.</li></ul><h3>Step 3: Enabling the Nginx Website</h3><p>After creating the configuration, I enabled the website using a symbolic link.</p><pre>sudo ln -s /etc/nginx/sites-available/sebastian-resume /etc/nginx/sites-enabled/</pre><p>Then I checked the Nginx configuration:</p><pre>sudo nginx -t</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*lE6tS92SOB059QoTsI7IpQ.png" /></figure><p>After successful validation, I restarted Nginx:</p><pre>sudo systemctl restart nginx</pre><p>The Nginx configuration was successfully applied.</p><h3>Step 4: Configuring the Custom Local Domain</h3><p>One of the important steps was mapping my custom domain to my Ubuntu server’s IP address.</p><p>My Ubuntu machine’s local IPv4 address was:</p><p>192.168.1.12</p><p>I opened the Linux hosts file:</p><pre>sudo nano /etc/hosts</pre><p>I added the following entry:</p><pre>192.168.1.12 www.sebastian.local</pre><p>This configuration allows my Ubuntu machine to resolve the custom domain to its local IP address.</p><p>I verified the domain resolution using:</p><pre>getent hosts www.sebastian.local</pre><p>The domain successfully resolved to my Ubuntu server’s IP address.</p><h3>Step 5: Accessing the Resume Through a Browser</h3><p>Finally, I opened Firefox and entered:</p><pre>http://www.sebastian.local</pre><p>My personal resume website was successfully displayed in the browser.</p><p>This confirmed that:</p><ul><li>The HTML website was accessible.</li><li>Nginx was serving the website.</li><li>The virtual host configuration was working.</li><li>The custom domain was resolving correctly.</li></ul><p>It was exciting to see my own resume website accessible through a custom domain!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v8T-O9UF2j76UWnea8GJ1A.png" /></figure><h3>Final Architecture</h3><p>The project architecture looks like this:</p><pre>Web Browser<br>               |<br>               |<br>    www.sebastian.local<br>               |<br>               |<br>        Linux Hosts File<br>               |<br>               |<br>         192.168.1.12<br>               |<br>               |<br>             NGINX<br>               |<br>               |<br>       Nginx Virtual Host<br>               |<br>               |<br> /var/www/sebastian-resume/<br>               |<br>               |<br>           index.html<br>               |<br>               |<br>         Resume Website</pre><h3>What I Learned</h3><p>Through this project, I gained practical experience in:</p><ol><li>Creating a personal website using HTML and CSS.</li><li>Hosting a static website using Nginx.</li><li>Configuring Nginx virtual hosts.</li><li>Understanding custom local domain configuration.</li><li>Mapping domain names using the Linux hosts file.</li><li>Understanding how browsers communicate with web servers.</li><li>Testing Nginx configurations and troubleshooting website access.</li></ol><h3>Conclusion</h3><p>This project helped me understand the fundamentals of website hosting and web server configuration.</p><p>I learned how to create a resume website, configure Nginx, set up a custom local domain, and access the website through a browser without directly entering the server’s IP address.</p><p>It was another valuable hands-on experience in my DevOps learning journey.</p><p>I’m continuing to improve my Linux administration, web hosting, networking, and DevOps skills through practical projects.</p><p><strong>More hands-on projects coming soon!</strong></p><p>#DevOps #Linux #Ubuntu #Nginx #WebServer #HTML #WebHosting #SystemAdministration #Networking #LearningByDoing</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28f2f4563a65" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building and Deploying a Python Backend with MongoDB, Systemd, and Nginx on Ubuntu 26.04]]></title>
            <link>https://medium.com/@sebastian.sojan.official/building-and-deploying-a-python-backend-with-mongodb-systemd-and-nginx-on-ubuntu-26-04-335ab846b35e?source=rss-ce1f6cb5f57f------2</link>
            <guid isPermaLink="false">https://medium.com/p/335ab846b35e</guid>
            <dc:creator><![CDATA[Sebastian Sojan]]></dc:creator>
            <pubDate>Mon, 16 Nov 2026 19:12:48 GMT</pubDate>
            <atom:updated>2026-11-16T19:12:48.320Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>As part of my DevOps learning journey, I successfully completed a project focused on deploying a Python backend application connected to MongoDB and managing it as a Linux system service.</p><p>The main objective was to understand how backend applications, databases, Linux services, and web servers work together in a real-world deployment environment.In this project, I used MongoDB for database management, Python Flask to develop the backend API, Gunicorn to serve the application, systemd to manage the application service, and Nginx as a reverse proxy.</p><h3>Project Objectives</h3><p>The main tasks of this project were:</p><ul><li>Install and configure MongoDB.</li><li>Create a database and collection.</li><li>Develop a simple Python Flask backend.</li><li>Connect the backend application to MongoDB.</li><li>Run the backend as a systemd service.</li><li>Configure automatic service startup.</li><li>Install and configure Nginx.</li><li>Set up Nginx as a reverse proxy.</li><li>Test the complete application.</li></ul><h3>Step 1: Installing MongoDB</h3><p>I started by updating the Ubuntu system and installing MongoDB Community Edition using its official repository.</p><p>After installation, I started the MongoDB service and enabled it to start automatically during system boot.</p><p>Commands used:</p><pre>sudo systemctl start mongod<br>sudo systemctl enable mongod<br>sudo systemctl status mongod</pre><p>I verified the installation using the MongoDB shell:</p><pre>mongosh</pre><p>MongoDB was successfully installed and running.</p><h3>Step 2: Creating a Database and Collection</h3><p>After connecting to MongoDB, I created a database named:</p><p>devops_project</p><p>Then I created a collection called:</p><p>users</p><p>Commands:</p><pre>use devops_project</pre><pre>db.createCollection(&quot;users&quot;)</pre><p>I inserted a sample document:</p><pre>db.users.insertOne({<br>    name: &quot;Sebastian&quot;,<br>    role: &quot;DevOps Engineer&quot;,<br>    project: &quot;MongoDB Backend&quot;<br>})</pre><p>To verify the inserted data:</p><pre>db.users.find()</pre><p>The document was successfully stored and retrieved from MongoDB.</p><h3>Step 3: Developing the Python Flask Backend</h3><p>Next, I created a Python project directory and configured a virtual environment.</p><pre>mkdir -p ~/mongodb-project<br>cd ~/mongodb-project</pre><pre>python3 -m venv venv</pre><pre>source venv/bin/activate</pre><p>I installed the required Python packages:</p><pre>pip install Flask pymongo gunicorn</pre><p>I developed a simple Flask backend application with the following API endpoints:</p><ul><li>/ – Displays the application status.</li><li>/health – Checks MongoDB connectivity.</li><li>/users – Retrieves users from MongoDB.</li><li>/users (POST) – Inserts a new user into MongoDB.</li></ul><p>The backend successfully connected to MongoDB using PyMongo.</p><h3>Step 4: Running the Backend with Gunicorn</h3><p>Instead of relying on Flask’s development server, I used Gunicorn to serve the Python application.</p><p>Command:</p><pre>gunicorn --workers 2 --bind 127.0.0.1:5000 app:app</pre><p>The backend was running successfully on port 5000.</p><p>I tested the application using:</p><pre>curl http://127.0.0.1:5000/</pre><p>I also checked the database connection:</p><pre>curl http://127.0.0.1:5000/health</pre><p>Both tests returned successful responses.</p><h3>Step 5: Configuring systemd</h3><p>One of the important parts of this project was configuring the Python backend as a Linux system service.</p><p>I created the following service file:</p><pre>sudo nano /etc/systemd/system/python-backend.service</pre><p>Configuration:</p><pre>[Unit]<br>Description=Python Flask Backend<br>After=network.target mongod.service<br>Requires=mongod.service</pre><pre>[Service]<br>User=sebastian<br>Group=sebastian<br>WorkingDirectory=/home/sebastian/mongodb-project<br>ExecStart=/home/sebastian/mongodb-project/venv/bin/gunicorn --workers 2 --bind 127.0.0.1:5000 app:app<br>Restart=always<br>RestartSec=5</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>After creating the service file, I reloaded systemd and started the backend service.</p><pre>sudo systemctl daemon-reload</pre><pre>sudo systemctl start python-backend</pre><pre>sudo systemctl enable python-backend</pre><p>I verified the service:</p><pre>sudo systemctl status python-backend</pre><p>The service was successfully running in the background.</p><p>This configuration also enables automatic startup when the system boots.</p><h3>Step 6: Installing and Configuring Nginx</h3><p>Next, I installed Nginx:</p><pre>sudo apt update<br>sudo apt install nginx -y</pre><p>I started and enabled the Nginx service:</p><pre>sudo systemctl start nginx<br>sudo systemctl enable nginx</pre><p>I created an Nginx configuration file:</p><pre>sudo nano /etc/nginx/sites-available/python-backend</pre><p>Configuration:</p><pre>server {<br>    listen 80;<br>    server_name _;</pre><pre>    location / {<br>        proxy_pass <a href="http://127.0.0.1:5000;">http://127.0.0.1:5000;</a></pre><pre>        proxy_set_header Host $host;<br>        proxy_set_header X-Real-IP $remote_addr;<br>        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>        proxy_set_header X-Forwarded-Proto $scheme;<br>    }<br>}</pre><p>I enabled the configuration:</p><pre>sudo ln -s /etc/nginx/sites-available/python-backend /etc/nginx/sites-enabled/</pre><p>Then I removed the default Nginx configuration:</p><pre>sudo rm /etc/nginx/sites-enabled/default</pre><p>I tested the Nginx configuration:</p><pre>sudo nginx -t</pre><p>After successful validation, I restarted Nginx:</p><pre>sudo systemctl restart nginx</pre><p>Nginx was now forwarding incoming HTTP requests to the Python backend.</p><h3>Step 7: Testing the Complete Application</h3><p>Finally, I tested the application through Nginx.</p><p>Instead of accessing the backend directly through port 5000, I accessed it through port 80.</p><p><strong>Test 1: Application status</strong></p><pre>curl http://localhost/</pre><p>Response:</p><pre>{<br>    &quot;database&quot;: &quot;MongoDB Connected&quot;,<br>    &quot;message&quot;: &quot;Python Backend is Running!&quot;<br>}</pre><p><strong>Test 2: MongoDB health check</strong></p><pre>curl http://localhost/health</pre><p>Response:</p><pre>{<br>    &quot;mongodb&quot;: &quot;connected&quot;,<br>    &quot;status&quot;: &quot;healthy&quot;<br>}</pre><p><strong>Test 3: Retrieve users</strong></p><pre>curl http://localhost/users</pre><p>The application successfully retrieved user records from MongoDB.</p><p><strong>Test 4: Insert a new user</strong></p><pre>curl -X POST http://localhost/users \<br>-H &quot;Content-Type: application/json&quot; \<br>-d &#39;{&quot;name&quot;:&quot;Sebastian&quot;,&quot;role&quot;:&quot;DevOps Engineer&quot;}&#39;</pre><p>The API successfully inserted the new user into MongoDB.</p><p>All the tests were successful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*YJExj6wv0gFnyOk82DS81Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/519/1*YJExj6wv0gFnyOk82DS81Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*0prkF5Y0FT2FgGV7HRKnyQ.png" /></figure><h3>Final Architecture</h3><p>The final application architecture looks like this:</p><pre>Web Browser<br>                  |<br>                  |<br>              HTTP :80<br>                  |<br>                NGINX<br>            (Reverse Proxy)<br>                  |<br>                  |<br>             Gunicorn<br>              :5000<br>                  |<br>                  |<br>            Python Flask<br>               Backend<br>                  |<br>                  |<br>               PyMongo<br>                  |<br>                  |<br>              MongoDB<br>              :27017<br>                  |<br>             devops_project<br>                  |<br>                users</pre><h3>What I Learned</h3><p>Working on this project helped me understand several important DevOps concepts:</p><ol><li>Installing and managing MongoDB on Ubuntu.</li><li>Creating databases and managing collections.</li><li>Developing a REST API using Python Flask.</li><li>Connecting a Python application to MongoDB.</li><li>Using Gunicorn to serve a Python backend.</li><li>Managing applications using systemd.</li><li>Configuring automatic service startup.</li><li>Setting up Nginx as a reverse proxy.</li><li>Testing API endpoints using curl.</li><li>Understanding how databases, backend applications, and web servers work together.</li></ol><h3>Conclusion</h3><p>This project gave me practical experience deploying a backend application on a Linux server.</p><p>I learned how MongoDB stores application data, how Python Flask communicates with the database, how systemd manages application processes, and how Nginx forwards incoming requests to the backend.</p><p>Successfully connecting all these components helped me understand the fundamentals of application deployment and Linux server administration.</p><p>This is another important step in my DevOps learning journey.</p><p><strong>More projects and hands-on learning coming soon!</strong></p><p>#DevOps #Linux #Ubuntu #MongoDB #Python #Flask #Nginx #Systemd #Gunicorn #BackendDevelopment #LearningByDoing</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=335ab846b35e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Centralized Logging Server Using rsyslog on Two Ubuntu Machines]]></title>
            <link>https://medium.com/@sebastian.sojan.official/building-a-centralized-logging-server-using-rsyslog-on-two-ubuntu-machines-5f738b4fcfb0?source=rss-ce1f6cb5f57f------2</link>
            <guid isPermaLink="false">https://medium.com/p/5f738b4fcfb0</guid>
            <dc:creator><![CDATA[Sebastian Sojan]]></dc:creator>
            <pubDate>Thu, 12 Nov 2026 10:25:07 GMT</pubDate>
            <atom:updated>2026-11-12T10:25:07.871Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>As part of my Linux System Administration and DevOps learning journey, I worked on building a Centralized Logging Server using <strong>rsyslog</strong>.</p><p>In my previous work, I explored Linux log management using rsyslog, journalctl, and logrotate. In this extension, I took the project further by connecting two Ubuntu machines and configuring one machine to collect logs from the other.</p><p>The main objective was to centralize logs so that system administrators can monitor logs from multiple machines in one location.</p><h3>Project Architecture</h3><p>For this project, I used two Ubuntu machines connected to the same local network.</p><ul><li><strong>Central Logging Server:</strong> Mjolnir</li><li><strong>Remote Client:</strong> bvthz</li><li><strong>Server IP Address:</strong> 192.168.1.8</li><li><strong>Client IP Address:</strong> 192.168.1.23</li><li><strong>Protocol:</strong> TCP</li><li><strong>Port:</strong> 514</li><li><strong>Logging Service:</strong> rsyslog</li></ul><p>The client forwards its system logs to the central server over TCP.</p><p>The central server receives and stores those logs in separate directories based on the client’s IP address, hostname, and application name.</p><h3>Step 1: Installing rsyslog</h3><p>I used rsyslog on both Ubuntu machines.</p><p>To install it, I ran:</p><pre>sudo apt update<br>sudo apt install rsyslog -y</pre><p>Then I enabled and started the service:</p><pre>sudo systemctl enable --now rsyslog</pre><p>I checked the service status:</p><pre>sudo systemctl status rsyslog</pre><p>This confirmed that rsyslog was running.</p><h3>Step 2: Configuring the Central Logging Server</h3><p>On my main machine (Mjolnir), I configured rsyslog to receive remote logs over TCP port 514.</p><p>I edited the main configuration file:</p><pre>sudo nano /etc/rsyslog.conf</pre><p>I enabled the TCP input module:</p><pre>module(load=&quot;imtcp&quot;)<br>input(type=&quot;imtcp&quot; port=&quot;514&quot;)</pre><p>This allows the server to receive logs from remote machines over TCP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VTkwzfUdu-ZUu2arU8ez4g.png" /></figure><h3>Step 3: Creating a Remote Log Directory</h3><p>Next, I created a directory to store logs received from the remote machine:</p><pre>sudo mkdir -p /var/log/remote</pre><p>I configured a dynamic file template in:</p><pre>sudo nano /etc/rsyslog.d/10-remote.conf</pre><p>Configuration:</p><pre>template(name=&quot;RemoteLogs&quot; type=&quot;string&quot;<br> string=&quot;/var/log/remote/%fromhost-ip%/%HOSTNAME%/%PROGRAMNAME%.log&quot;)</pre><pre>if ($fromhost-ip == &quot;192.168.1.23&quot;) then {<br>    action(type=&quot;omfile&quot; dynaFile=&quot;RemoteLogs&quot; createDirs=&quot;on&quot;)<br>    stop<br>}</pre><p>This configuration organizes incoming logs by:</p><ul><li>Client IP address</li><li>Client hostname</li><li>Program name</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RBGtMOxyt9-exbZbXMGAuQ.png" /></figure><p>For example:</p><pre>/var/log/remote/192.168.1.23/bvthz/</pre><h3>Step 4: Configuring the Remote Client</h3><p>On my friend’s Ubuntu machine (bvthz), I configured rsyslog to forward logs to my central server.</p><p>I created the forwarding configuration:</p><pre>sudo nano /etc/rsyslog.d/60-forward.conf</pre><p>I added:</p><pre>*.* @@192.168.1.8:514</pre><p>Here:</p><ul><li>*.* means all facilities and priorities.</li><li>@@ specifies TCP forwarding.</li><li>192.168.1.8 is the central server IP.</li><li>514 is the receiving port.</li></ul><p>This configuration forwards the client’s logs to my central logging server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*yKSCwbcCKSXQCqRPbyMD5g.png" /></figure><h3>Step 5: Validating the Configuration</h3><p>Before restarting rsyslog, I checked the configuration on both machines.</p><p>Command:</p><pre>sudo rsyslogd -N1</pre><p>The successful validation message was:</p><pre>rsyslogd: End of config validation run. Bye.</pre><p>Then I restarted the service:</p><pre>sudo systemctl restart rsyslog</pre><p>I also checked that the service was active.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5V1d8F4GSjlTcXNCWfy_pA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E6hNupNcAcQ9-ET_cFW6NQ.png" /></figure><h3>Step 6: Verifying the Server Listening Port</h3><p>On my central server, I checked whether rsyslog was listening on TCP port 514:</p><pre>sudo ss -lntp | grep &#39;:514&#39;</pre><p>The output confirmed that rsyslog was listening on port 514.</p><p>This was an important step because the client needed to connect to this port to forward its logs.</p><h3>Step 7: Troubleshooting Permission Errors</h3><p>During testing, I encountered an issue.</p><p>The central server was receiving logs, but rsyslog could not create directories under:</p><pre>/var/log/remote/</pre><p>The journal showed:</p><pre>omfile: creating parent directories failed: Permission denied</pre><p>I investigated the issue and corrected the remote log directory permissions:</p><pre>sudo chown -R syslog:adm /var/log/remote<br>sudo chmod -R 755 /var/log/remote</pre><p>I restarted rsyslog after making the changes:</p><pre>sudo systemctl restart rsyslog</pre><p>After fixing the permissions, the remote log directories and files were created successfully.</p><p>This troubleshooting experience helped me understand the importance of Linux file ownership and permissions when configuring system services.</p><h3>Step 8: Sending a Test Message</h3><p>To verify the complete setup, I sent a custom test message from my friend’s Ubuntu machine:</p><pre>logger &quot;CENTRALIZED LOGGING TEST SUCCESS&quot;</pre><p>Then, on my central logging server, I searched for that message:</p><pre>sudo grep -R &quot;CENTRALIZED LOGGING TEST SUCCESS&quot; /var/log/remote/</pre><p>I received the following output:</p><pre>/var/log/remote/192.168.1.23/bvthz/binil-vincent.log:</pre><pre>2026-11-11T23:12:35+05:30 bvthz binil-vincent:<br>CENTRALIZED LOGGING TEST SUCCESS</pre><p>This confirmed that the message generated on the remote Ubuntu machine was successfully received and stored on my central logging server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Up9K4MVjU940CZ8naLB3WA.png" /></figure><h3>Step 9: Checking the Remote Log Files</h3><p>I also checked the files created by rsyslog:</p><pre>sudo find /var/log/remote -type f</pre><p>The server created separate log files, including:</p><pre>grafana.log<br>rsyslogd.log<br>NetworkManager.log<br>wpa_supplicant.log<br>systemd.log<br>dbus-daemon.log<br>auditd.log<br>kernel.log<br>binil-vincent.log</pre><p>This demonstrated that logs from different system services and applications were being collected and organized centrally.</p><h3>What I Learned</h3><p>Through this project, I gained practical experience with:</p><ul><li>Installing and configuring rsyslog on multiple Ubuntu machines.</li><li>Configuring a centralized logging server.</li><li>Forwarding logs using TCP.</li><li>Understanding TCP port 514.</li><li>Creating dynamic log file templates.</li><li>Organizing remote logs by IP address, hostname, and program.</li><li>Troubleshooting Linux file ownership and permission issues.</li><li>Validating rsyslog configurations.</li><li>Verifying remote log delivery using the logger command and grep.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MVTBNxN9rcD-JIQrMHjXeA.png" /></figure><h3>Conclusion</h3><p>This project helped me understand how centralized logging works in a real Linux environment.Instead of checking logs separately on every machine, I configured one Ubuntu machine to collect and store logs from another Ubuntu machine.Successfully receiving the custom test message confirmed that my two-machine centralized logging setup was working.I will continue improving my Linux administration and DevOps skills by working on more practical projects.</p><p><strong>Learning by doing, troubleshooting, and improving every day!</strong></p><p>#Linux #LinuxAdministration #DevOps #Ubuntu #Rsyslog #CentralizedLogging #SystemAdministration #Monitoring #Networking #LearningByDoin</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5f738b4fcfb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Log Analysis Server — Monitoring, Log Rotation and SSH Security]]></title>
            <link>https://medium.com/@sebastian.sojan.official/linux-log-analysis-server-monitoring-log-rotation-and-ssh-security-cd67f7fa4b3b?source=rss-ce1f6cb5f57f------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd67f7fa4b3b</guid>
            <dc:creator><![CDATA[Sebastian Sojan]]></dc:creator>
            <pubDate>Wed, 11 Nov 2026 11:31:16 GMT</pubDate>
            <atom:updated>2026-11-11T11:31:16.302Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>As part of my DevOps learning journey, I recently completed Project 12: Linux Log Analysis Server.</p><p>System log management is an important part of Linux system administration. Every Linux server generates logs that help administrators monitor system activities, troubleshoot problems, and identify potential security threats.</p><p>For this project, I worked with three important Linux logging tools:</p><ul><li><strong>rsyslog</strong> — Collecting and managing system logs.</li><li><strong>journalctl</strong> — Monitoring and analyzing system logs.</li><li><strong>logrotate</strong> — Managing, rotating, and compressing log files.</li></ul><p>The main objective was to understand how Linux logs work and how administrators can use them to monitor server activities.</p><h3>Project Objectives</h3><p>The main tasks of this project were:</p><ol><li>Centralize system logs.</li><li>Monitor logs in real time.</li><li>Configure automatic log rotation.</li><li>Identify failed SSH login attempts.</li><li>Generate log analysis reports.</li><li>Explore advanced centralized logging across multiple Linux servers.</li></ol><h3>1. Installing Required Packages</h3><p>I started by updating my Ubuntu system and installing the required packages.</p><pre>sudo apt update<br>sudo apt upgrade -y</pre><p>Installed rsyslog and logrotate:</p><pre>sudo apt install rsyslog logrotate -y</pre><p>Enabled the rsyslog service:</p><pre>sudo systemctl enable --now rsyslog</pre><p>Verified the service:</p><pre>sudo systemctl status rsyslog</pre><h3>2. Monitoring Logs Using journalctl</h3><p>Next, I explored journalctl, which allows administrators to view and analyze systemd journal logs.</p><p>Some useful commands I practiced:</p><p>View all logs:</p><pre>sudo journalctl</pre><p>View the latest 50 log entries:</p><pre>sudo journalctl -n 50</pre><p>Monitor logs in real time:</p><pre>sudo journalctl -f</pre><p>Monitor SSH service logs:</p><pre>sudo journalctl -u ssh</pre><p>One important thing I learned is that journalctl -f continuously displays new log entries.</p><p>To stop real-time monitoring, press:</p><p><strong>Ctrl + C</strong></p><h3>3. Managing Logs Using rsyslog</h3><p>I explored rsyslog, which is responsible for collecting and processing system log messages.</p><p>Some important Linux log files include:</p><p>Log FilePurpose/var/log/syslogGeneral system logs/var/log/auth.logAuthentication and security logs/var/log/kern.logKernel-related logs/var/log/dpkg.logPackage management logs</p><p>I checked the available log files using:</p><pre>ls -lh /var/log/</pre><p>This helped me understand how Linux stores different types of system information.</p><h3>4. Configuring Log Rotation Using logrotate</h3><p>Log files can grow significantly over time. If they are not managed properly, they can consume valuable disk space.</p><p>To solve this problem, I explored logrotate.</p><p>Checked the main configuration:</p><pre>cat /etc/logrotate.conf</pre><p>Checked application-specific configurations:</p><pre>ls /etc/logrotate.d/</pre><p>Tested the logrotate configuration:</p><pre>sudo logrotate -d /etc/logrotate.conf</pre><p>Forced log rotation:</p><pre>sudo logrotate -f /etc/logrotate.conf</pre><p>I learned how logrotate helps administrators:</p><ul><li>Rotate log files automatically.</li><li>Compress old logs.</li><li>Retain a specified number of previous logs.</li><li>Prevent excessive disk usage.</li></ul><h3>5. Identifying Failed SSH Login Attempts</h3><p>Security monitoring is another important responsibility of a Linux administrator.</p><p>I explored how to identify failed SSH login attempts through authentication logs.</p><p>Initially, I used:</p><pre>sudo grep &quot;Failed password&quot; /var/log/auth.log</pre><p>However, I noticed that the command also matched entries generated by sudo itself.</p><p>To narrow the search to actual SSH daemon messages, I used:</p><pre>sudo grep -E &#39;sshd\[[0-9]+\]: Failed password&#39; /var/log/auth.log</pre><p>To count matching entries:</p><pre>sudo grep -Ec &#39;sshd\[[0-9]+\]: Failed password&#39; /var/log/auth.log</pre><p>This taught me an important lesson: log analysis requires accurate filtering to avoid misleading results.</p><h3>6. Generating Log Analysis Reports</h3><p>Next, I created a directory to store my reports.</p><pre>mkdir -p ~/log-reports</pre><p>Created a report for failed SSH login attempts:</p><pre>sudo grep -E &#39;sshd\[[0-9]+\]: Failed password&#39; /var/log/auth.log &gt; ~/log-reports/failed-ssh.log</pre><p>Created a report for successful SSH logins:</p><pre>sudo grep -E &#39;sshd\[[0-9]+\]: Accepted (password|publickey)&#39; /var/log/auth.log &gt; ~/log-reports/successful-ssh.log</pre><p>Generated a summary report:</p><pre>echo &quot;Linux Log Analysis Report&quot; &gt; ~/log-reports/summary.txt</pre><pre>echo &quot;=========================&quot; &gt;&gt; ~/log-reports/summary.txt</pre><pre>echo &quot;Failed SSH Attempts:&quot; &gt;&gt; ~/log-reports/summary.txt</pre><pre>sudo grep -Ec &#39;sshd\[[0-9]+\]: Failed password&#39; /var/log/auth.log &gt;&gt; ~/log-reports/summary.txt</pre><pre>echo &quot;Successful SSH Logins:&quot; &gt;&gt; ~/log-reports/summary.txt</pre><pre>sudo grep -Ec &#39;sshd\[[0-9]+\]: Accepted (password|publickey)&#39; /var/log/auth.log &gt;&gt; ~/log-reports/summary.txt</pre><p>Finally, I viewed the generated report:</p><pre>cat ~/log-reports/summary.txt</pre><p>My reports were saved in:</p><pre>/home/sebastian/log-reports/</pre><p>The directory contains:</p><ul><li>failed-ssh.log</li><li>successful-ssh.log</li><li>summary.txt</li></ul><h3>7. Skills Learned</h3><p>Through this project, I gained practical knowledge of:</p><ul><li>Linux System Administration</li><li>rsyslog Configuration</li><li>journalctl Monitoring</li><li>Logrotate Configuration</li><li>SSH Security Monitoring</li><li>Authentication Log Analysis</li><li>Bash Commands</li><li>Log Report Generation</li><li>Linux Troubleshooting</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*61MjtjgRv-gb7QydFUtsHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UCbdzyStAPTpn4QPqXXu7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TsdWOUlEA6YGldQoZ1AWbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4u2MS0ye2pDk92VGLSVN-A.png" /></figure><h3>Conclusion</h3><p>Completing this project helped me understand the importance of log management in Linux environments.I learned how to monitor system activities, manage log files, investigate authentication events, and generate reports.This project improved my practical Linux administration and DevOps skills.I am continuing my journey of learning DevOps through hands-on projects, one step at a time.</p><p><strong>More projects and learning experiences coming soon!</strong></p><p>#Linux #LinuxAdministration #DevOps #Rsyslog #Journalctl #Logrotate #SystemMonitoring #SSH #CyberSecurity #DevOpsProjects #Ubuntu</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd67f7fa4b3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Milk Society Management System Using Microservices, Docker & Kubernetes]]></title>
            <link>https://medium.com/@sebastian.sojan.official/building-a-milk-society-management-system-using-microservices-docker-kubernetes-2b3cdc547aa1?source=rss-ce1f6cb5f57f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b3cdc547aa1</guid>
            <dc:creator><![CDATA[Sebastian Sojan]]></dc:creator>
            <pubDate>Mon, 09 Nov 2026 23:42:06 GMT</pubDate>
            <atom:updated>2026-11-09T23:42:06.347Z</atom:updated>
            <content:encoded><![CDATA[<h3>A hands-on DevOps project exploring containerization, Python microservices, PostgreSQL, and Kubernetes deployment.</h3><h3>Introduction</h3><p>While learning DevOps, I wanted to build a practical project that would help me understand how real-world applications are structured, containerized, and deployed using Kubernetes.</p><p>Instead of building a traditional monolithic application, I decided to develop a <strong>Milk Society Management System using Microservices Architecture</strong>.</p><p>The main objective was to separate application functionalities into independent services, containerize each component using Docker, and deploy the complete application using Kubernetes with Minikube.</p><h3>1. Project Overview</h3><p>The Milk Society Management System is a web application designed to help milk societies manage their suppliers and milk pricing.</p><p>The application contains three main backend services:</p><ul><li><strong>List Suppliers:</strong> Retrieves and displays registered milk suppliers.</li><li><strong>Add Suppliers:</strong> Allows the society to register new suppliers.</li><li><strong>Set Milk Rate:</strong> Allows the society to configure the milk price per litre.</li><li>The frontend provides a dashboard to interact with these services.</li></ul><h3>2. Technology Stack</h3><p>The project uses the following technologies:</p><p>TechnologyPurposeHTML, CSS, JavaScriptFrontendNginxFrontend web serverPythonBackend developmentFastAPIREST API developmentPostgreSQLDatabaseDockerContainerizationKubernetesContainer orchestrationMinikubeLocal Kubernetes environment</p><h3>3. Microservices Architecture</h3><p>One of the main objectives was to understand how microservices architecture works in a practical environment.</p><p>Instead of developing one large backend application, I separated the backend into three independent Python services.</p><p>Each service has:</p><ul><li>Its own application code.</li><li>Its own Dockerfile.</li><li>Its own Docker image.</li><li>Its own Kubernetes Deployment.</li><li>Its own Kubernetes Service.</li></ul><p>All three services communicate with the PostgreSQL database to manage application data.</p><p>This separation makes the application easier to maintain, update, and scale independently.</p><h3>4. Project Folder Structure</h3><p>I organized the project into three main directories: frontend, backend, and Kubernetes configuration.</p><pre>milk-society/<br>│<br>├── frontend/<br>│   ├── index.html<br>│   └── Dockerfile<br>│<br>├── backend/<br>│   │<br>│   ├── list-suppliers/<br>│   │   ├── app.py<br>│   │   └── Dockerfile<br>│   │<br>│   ├── add-supplier/<br>│   │   ├── app.py<br>│   │   └── Dockerfile<br>│   │<br>│   └── set-milk-rate/<br>│       ├── app.py<br>│       └── Dockerfile<br>│<br>├── kubernetes/<br>│   ├── postgres.yaml<br>│   └── application.yaml<br>│<br>└── README.md</pre><p>The frontend contains a single HTML file with styling and JavaScript, served through an Nginx container.</p><p>Each backend service is maintained separately.</p><h3>5. Frontend Using Nginx</h3><p>For the frontend, I used a lightweight Nginx container.</p><p>Instead of introducing a complex frontend framework, I kept the interface simple using HTML, CSS, and JavaScript.</p><p>Nginx serves the static frontend files and provides the interface through which users interact with the backend APIs.</p><h3>6. Backend Using Python Microservices</h3><p>The backend consists of three independent services developed using Python and FastAPI.</p><p><strong>Service 1 — List Suppliers</strong></p><p>Responsible for retrieving supplier information from PostgreSQL.</p><p><strong>Service 2 — Add Suppliers</strong></p><p>Handles supplier registration and stores supplier information in the database.</p><p><strong>Service 3 — Set Milk Rate</strong></p><p>Manages milk pricing and stores the configured rate in PostgreSQL.</p><p>Each service is containerized independently using Docker.</p><h3>7. PostgreSQL Database</h3><p>PostgreSQL is used as the application’s relational database.</p><p>It stores:</p><ul><li>Supplier information.</li><li>Supplier contact details.</li><li>Milk pricing information.</li></ul><p>The database runs in a separate container and is deployed inside Kubernetes.</p><p>Persistent storage is important because database information should survive container restarts.</p><h3>8. Docker Containerization</h3><p>Each application component is packaged into its own Docker image.</p><p>The images include:</p><ul><li>milk-frontend</li><li>milk-list-suppliers</li><li>milk-add-supplier</li><li>milk-set-milk-rate</li><li>PostgreSQL</li></ul><p>This allows each component to run independently in its own container.</p><h3>9. Kubernetes Deployment Using Minikube</h3><p>For orchestration, I chose Kubernetes and Minikube.</p><p>Minikube provides a local Kubernetes environment where I can deploy and test the application without requiring a cloud-based Kubernetes cluster.</p><p>The deployment process involves:</p><ol><li>Starting the Minikube cluster.</li><li>Building Docker images.</li><li>Deploying PostgreSQL.</li><li>Creating Kubernetes Deployments.</li><li>Configuring Kubernetes Services.</li><li>Exposing the frontend through an Ingress or another suitable access method.</li><li>Verifying the running pods and services.</li></ol><p>Useful Kubernetes commands:</p><pre>minikube start --driver=docker</pre><pre>kubectl apply -f kubernetes/postgres.yaml</pre><pre>kubectl apply -f kubernetes/application.yaml</pre><p>Check running pods:</p><pre>kubectl get pods</pre><p>Check services:</p><pre>kubectl get services</pre><p>Check deployments:</p><pre>kubectl get deployments</pre><h3>10. What I Learned</h3><p>Working on this project helped me understand several important DevOps concepts:</p><ul><li>Designing applications using microservices architecture.</li><li>Creating independent Docker images</li><li>Writing Dockerfiles for Python applications.</li><li>Running Nginx inside a container.</li><li>Connecting backend services with PostgreSQL.</li><li>Understanding Kubernetes Deployments and Services.</li><li>Deploying multi-container applications using Minikube.</li><li>Understanding application communication inside Kubernetes.</li></ul><h3>Conclusion</h3><p>This project is part of my journey toward becoming a Cloud and DevOps Engineer.</p><p>Building an application is one thing, but understanding how to containerize it, manage its services, connect its database, and deploy everything through Kubernetes provides a much deeper understanding of real-world infrastructure.</p><p>My next objective is to extend this project by implementing:</p><ul><li>Prometheus and Grafana for monitoring.</li><li>Horizontal Pod Autoscaling (HPA).</li><li>GitHub Actions for CI/CD automation.</li><li>Terraform for infrastructure provisioning.</li><li>Cloud deployment using AWS.</li></ul><p>I’m looking forward to improving this project and exploring more DevOps tools along the way.</p><p><strong>Building. Breaking. Learning. Improving.</strong></p><p>#DevOps #Kubernetes #Docker #Microservices #Python #PostgreSQL #Minikube #Nginx #CloudComputing #AWS</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b3cdc547aa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a Microservices-Based Application on Kubernetes Using Minikube]]></title>
            <link>https://medium.com/@sebastian.sojan.official/deploying-a-microservices-based-application-on-kubernetes-using-minikube-934dd56620d2?source=rss-ce1f6cb5f57f------2</link>
            <guid isPermaLink="false">https://medium.com/p/934dd56620d2</guid>
            <dc:creator><![CDATA[Sebastian Sojan]]></dc:creator>
            <pubDate>Tue, 27 Oct 2026 17:24:14 GMT</pubDate>
            <atom:updated>2026-10-27T17:30:12.178Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>My Hands-On DevOps Project: StreamFlix — From Docker Images to Kubernetes Deployment.</strong></p><p>Kubernetes is one of the most important technologies in modern DevOps and cloud-native application development. But learning Kubernetes theoretically is different from deploying a real application and troubleshooting issues.Recently, I worked on a hands-on project called <strong>StreamFlix</strong>, a microservices-based streaming application deployed on Kubernetes using Minikube.</p><p>In this article, I’ll share the project architecture, tools used, deployment process, challenges encountered, and lessons learned during this journey.</p><h3>1. Project Overview</h3><p>StreamFlix is a microservices-based streaming application designed to demonstrate how multiple application components can run independently inside a Kubernetes cluster.</p><p>Instead of building one large application, the project separates its functionality into individual microservices.</p><p>The application consists of five components:</p><ul><li><strong>Frontend:</strong> Provides the user interface.</li><li><strong>Catalog:</strong> Manages the movie catalog.</li><li><strong>Watchlist:</strong> Handles users’ movie watchlists.</li><li><strong>Ratings:</strong> Manages movie ratings.</li><li><strong>Recommendations:</strong> Provides movie recommendations.</li></ul><p>Each component is containerized using Docker, while Kubernetes manages application deployment and service communication.</p><p>The primary goal was to understand how to deploy, manage, and troubleshoot a microservices application in a local Kubernetes environment.</p><h3>2. Technology Stack</h3><p>Here are the tools and technologies I used:</p><ul><li><strong>Docker:</strong> Containerizes the application components.</li><li><strong>Kubernetes:</strong> Orchestrates containers.</li><li><strong>Minikube:</strong> Runs a local Kubernetes cluster.</li><li><strong>kubectl:</strong> Manages Kubernetes resources.</li><li><strong>NGINX Ingress Controller:</strong> Routes HTTP traffic into the cluster.</li><li><strong>ConfigMap:</strong> Stores application configuration.</li><li><strong>PersistentVolumeClaim (PVC):</strong> Requests persistent storage.</li><li><strong>Metrics Server:</strong> Provides resource metrics.</li><li><strong>Horizontal Pod Autoscaler (HPA):</strong> Supports automatic scaling.</li><li><strong>NetworkPolicy:</strong> Defines rules for communication between Pods.</li></ul><p>My development environment used Ubuntu on WSL2 with Docker Desktop.</p><h3>3. Understanding the Architecture</h3><p>The application uses separate frontend and backend components.</p><p>The architecture includes:</p><ol><li>Frontend Deployment with two replicas.</li><li>Catalog Deployment initially configured with two replicas.</li><li>Watchlist Deployment.</li><li>Ratings Deployment.</li><li>Recommendations Deployment.</li><li>Kubernetes Services for internal communication.</li><li>An Ingress resource for HTTP routing.</li><li>Persistent storage for the watchlist database.</li></ol><p>The initial application configuration contains seven application Pods, excluding Kubernetes system Pods and the Ingress controller.</p><p>This architecture demonstrates how Kubernetes can manage multiple independent application components within a single cluster.</p><h3>4. Setting Up the Kubernetes Environment</h3><p>The first step was preparing the local Kubernetes environment.</p><p>After verifying that Docker, Minikube, and kubectl were installed, I started the cluster:</p><pre>minikube start --driver=docker</pre><p>Next, I enabled the NGINX Ingress Controller:</p><pre>minikube addons enable ingress</pre><p>I also enabled Metrics Server:</p><pre>minikube addons enable metrics-server</pre><p>To verify the cluster, I ran:</p><pre>kubectl get nodes</pre><p>The node reached the Ready state, confirming that Kubernetes was available for deployment.</p><p>I checked the Ingress controller using:</p><pre>kubectl get pods -n ingress-nginx</pre><p>This step helped me understand the importance of preparing and verifying the Kubernetes environment before deploying an application.</p><h3>5. Building Docker Images</h3><p>The next step was building Docker images for the five application components.</p><p>Instead of pushing the images to a remote container registry, I built them directly inside Minikube’s container environment.</p><p>For example, I built the frontend image using:</p><pre>minikube image build -t streamflix-frontend:1.0 ./frontend</pre><p>I followed the same process for the backend services:</p><pre>minikube image build -t streamflix-catalog:1.0 ./services/catalog</pre><pre>minikube image build -t streamflix-watchlist:1.0 ./services/watchlist</pre><pre>minikube image build -t streamflix-ratings:1.0 ./services/ratings</pre><pre>minikube image build -t streamflix-recommendations:1.0 ./services/recommendations</pre><p>To verify the images, I ran:</p><pre>minikube image ls</pre><p>This helped me confirm that the application images were available inside the Minikube environment.</p><h3>6. Deploying the Application on Kubernetes</h3><p>I organized the Kubernetes YAML manifests inside a k8s directory and applied them in a controlled sequence.</p><h3>Step 1: Create the Namespace</h3><pre>kubectl apply -f k8s/00-namespace.yaml</pre><p>A namespace helps separate application resources from resources belonging to other projects.</p><h3>Step 2: Configure the Application</h3><p>I applied the ConfigMap:</p><pre>kubectl apply -f k8s/01-configmap.yaml</pre><p>The ConfigMap stores non-sensitive configuration data used by the application.</p><h3>Step 3: Configure Persistent Storage</h3><p>I created the PersistentVolumeClaim:</p><pre>kubectl apply -f k8s/02-pvc.yaml</pre><p>Then I checked its status:</p><pre>kubectl get pvc -n streamflix</pre><p>The watchlist-pvc reached the Bound state with 1 GiB of storage.</p><p>This confirmed that Kubernetes had allocated the requested storage.</p><h3>Step 4: Deploy the Backend Microservices</h3><p>I deployed the catalog service using separate Deployment and Service manifests:</p><pre>kubectl apply -f k8s/03-catalog-deployment.yaml</pre><pre>kubectl apply -f k8s/04-catalog-service.yaml</pre><p>I followed the same approach for the watchlist, ratings, and recommendations services.</p><p>To inspect the Services, I ran:</p><pre>kubectl get services -n streamflix</pre><p>The backend Services were created successfully.</p><p>Each Service used the ClusterIP type, allowing other components inside the cluster to access it through Kubernetes networking.</p><h3>Step 5: Deploy the Frontend</h3><p>I applied the frontend Deployment and Service:</p><pre>kubectl apply -f k8s/11-frontend-deployment.yaml</pre><pre>kubectl apply -f k8s/12-frontend-service.yaml</pre><p>The frontend was configured with two replicas.</p><p>However, the frontend Pods encountered an image-pull problem, which became one of the main troubleshooting challenges in this project.</p><h3>🔍 7. Troubleshooting the ImagePullBackOff Error</h3><p>During deployment, I encountered the following Pod statuses:</p><pre>ImagePullBackOff<br>ErrImagePull</pre><p>The Kubernetes events indicated that the cluster was trying to pull the frontend image from Docker Hub.</p><p>The error included messages similar to:</p><pre>Failed to pull image &quot;streamflix-frontend:1.0&quot;</pre><pre>pull access denied</pre><p>The problem was that I intended to use images built locally inside Minikube, but Kubernetes was attempting to download the image from a remote registry.</p><p>I checked the locally available images:</p><pre>minikube image ls</pre><p>The five StreamFlix images were present.</p><p>This taught me an important Kubernetes lesson:</p><p><strong>Building a Docker image locally does not automatically guarantee that Kubernetes will use it.</strong></p><p>The image must be available to the container runtime used by the cluster, and the Deployment must have the correct image name and pull policy.</p><p>For locally available images, the IfNotPresent image pull policy allows Kubernetes to use an existing local image when available.</p><p>This experience helped me understand how to investigate image-pull failures using Kubernetes events and deployment configuration.</p><p>Instead of immediately recreating the cluster, I learned to investigate the underlying problem first.</p><h3>8. Configuring Kubernetes Ingress</h3><p>Ingress allows HTTP traffic to enter a Kubernetes cluster and routes requests to the appropriate Services.</p><p>I applied the Ingress configuration:</p><pre>kubectl apply -f k8s/13-ingress.yaml</pre><p>Then I checked the configuration:</p><pre>kubectl get ingress -n streamflix</pre><p>For local testing, I also used the following port-forwarding approach:</p><pre>kubectl port-forward -n streamflix service/frontend 8080:80</pre><p>The intended access URL was:</p><p><a href="http://localhost:8080/">http://localhost:8080</a></p><p>However, the frontend Pods initially had an ImagePullBackOff error, preventing successful access.</p><p>This reinforced another important lesson:</p><p><strong>Fix application and Pod issues before troubleshooting the networking layer.</strong></p><p>The frontend needs to be running and ready before its accessibility can be confirmed.</p><h3>9. Working with Persistent Storage</h3><p>Persistent storage is an important part of applications that need to retain data.Containers and Pods can be recreated during failures, updates, and scaling operations. Data stored only in a container’s writable layer may not survive that lifecycle.</p><p>In this project, a PersistentVolumeClaim was configured for the watchlist’s SQLite database.</p><p>The intended persistence test was to:</p><ol><li>Add a movie to the watchlist.</li><li>Identify the watchlist Pod.</li><li>Delete the Pod.</li><li>Allow Kubernetes to recreate it.</li><li>Check whether the movie remains in the watchlist.</li></ol><p>The PVC reaching the Bound state confirmed that storage was allocated. However, application-level testing is still necessary to verify that the database is correctly mounted and that data persists after the Pod is recreated.</p><p>This helped me understand the difference between allocating storage and verifying actual data persistence.</p><h3>10. Exploring Autoscaling and Network Policies</h3><p>The project also included configurations for Horizontal Pod Autoscaling and NetworkPolicies.</p><h3>Horizontal Pod Autoscaler (HPA)</h3><p>The HPA was configured to scale the catalog Deployment from two to five replicas based on CPU utilization.</p><p>I used the following commands to inspect the autoscaler and resource metrics:</p><pre>kubectl get hpa -n streamflix</pre><pre>kubectl top pods -n streamflix</pre><p>Successful autoscaling requires working resource metrics and suitable CPU resource requests. Actual scaling must be verified under appropriate load.</p><h3>NetworkPolicy</h3><p>A NetworkPolicy defines rules governing network communication between selected Pods.</p><p>I applied the project’s NetworkPolicy using:</p><pre>kubectl apply -f k8s/14-network-policy.yaml</pre><p>The intended configuration restricts incoming traffic to backend Pods so that only traffic from frontend Pods on TCP port 5000 is allowed.</p><p>However, actual enforcement depends on the cluster’s networking implementation.</p><p>These configurations introduced me to important Kubernetes concepts related to workload scaling and network security.</p><h3>11. Useful Kubernetes Commands</h3><p>Here are some commands I used throughout the project.</p><p><strong>Check Pods:</strong></p><pre>kubectl get pods -n streamflix</pre><p><strong>Inspect Pod details and events:</strong></p><pre>kubectl describe pods -n streamflix</pre><p><strong>Check Deployments:</strong></p><pre>kubectl get deployments -n streamflix</pre><p><strong>Check Services:</strong></p><pre>kubectl get services -n streamflix</pre><p><strong>Check persistent storage:</strong></p><pre>kubectl get pvc -n streamflix</pre><p><strong>Inspect recent events:</strong></p><pre>kubectl get events -n streamflix --sort-by=.lastTimestamp</pre><p>These commands are useful for troubleshooting scheduling problems, image-pull errors, container startup failures, storage issues, and service discovery.</p><h3>12. What I Learned from This Project</h3><p>This project helped me connect Kubernetes theory with practical deployment and troubleshooting.</p><p>My key takeaways were:</p><ul><li>A Kubernetes node can be Ready even when application Pods are failing.</li><li>Creating a Deployment does not guarantee that the application is healthy.</li><li>A Service can exist even when its backend Pods are not ready.</li><li>Locally built Docker images must be accessible to the cluster’s container runtime.</li><li>ImagePullBackOff errors can be investigated through Pod events and image configuration.</li><li>Persistent storage allocation and actual data persistence require separate verification.</li><li>Ingress troubleshooting is easier after the application and its Service are working.</li><li>NetworkPolicy enforcement depends on the cluster’s networking implementation.</li><li>HPA scaling requires working metrics and appropriate resource configuration.</li></ul><p>Most importantly, I learned the value of deploying resources step by step and verifying each stage before moving forward.</p><h3>Conclusion</h3><p>Building StreamFlix gave me hands-on experience with Docker, Kubernetes, Minikube, microservices, Deployments, Services, Ingress, persistent storage, NetworkPolicies, and autoscaling.The most valuable part of the project was not simply applying YAML files.</p><p>It was learning how to investigate errors, understand Kubernetes events, and troubleshoot issues involving container images, Pods, Services, and application availability.</p><p>My next milestone is to resolve the remaining image-pull issue, bring all application Pods to a healthy state, access the frontend successfully, and verify persistent watchlist data.This project is an important step in my journey toward improving my Kubernetes and DevOps skills.</p><p><strong>Thank you for reading!</strong></p><p>If you’re also learning Kubernetes or DevOps, feel free to share the projects you’re working on and the challenges you’ve encountered.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=934dd56620d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Mail Server Setup Using Postfix and Dovecot on Ubuntu]]></title>
            <link>https://medium.com/@sebastian.sojan.official/linux-mail-server-setup-using-postfix-and-dovecot-on-ubuntu-670d5c625ac4?source=rss-ce1f6cb5f57f------2</link>
            <guid isPermaLink="false">https://medium.com/p/670d5c625ac4</guid>
            <category><![CDATA[mail-server]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Sebastian Sojan]]></dc:creator>
            <pubDate>Mon, 26 Oct 2026 16:24:08 GMT</pubDate>
            <atom:updated>2026-10-26T16:24:08.019Z</atom:updated>
            <content:encoded><![CDATA[<p>As part of my Linux and DevOps learning journey, I recently worked on a project to set up a local mail server on Ubuntu Linux using Postfix and Dovecot.</p><p>Email servers are an important part of IT infrastructure. They allow users and applications to send, receive, and manage email messages. Understanding how mail servers work is a useful skill for anyone pursuing a career in Linux administration, system administration, or DevOps.</p><p>In this project, I installed and configured Postfix and Dovecot, created local mail users, tested email delivery between users, and configured email aliases.</p><h3>Project Objectives</h3><p>The main objectives of this project were:</p><ul><li>Install Postfix and Dovecot on Ubuntu.</li><li>Create local email users.</li><li>Send emails between local users.</li><li>Read and verify email messages.</li><li>Configure email aliases.</li><li>Verify that the required mail server ports are listening.</li></ul><h3>Technologies Used</h3><ul><li><strong>Operating System:</strong> Ubuntu Linux</li><li><strong>Postfix:</strong> Mail Transfer Agent (MTA) responsible for handling email delivery.</li><li><strong>Dovecot:</strong> Provides IMAP services so email clients can access mailboxes.</li><li><strong>Mailutils:</strong> Command-line utilities for sending and reading email.</li><li><strong>Systemd:</strong> Used to manage and check services.</li><li><strong>Linux terminal:</strong> Used for installation, configuration, and testing.</li></ul><h3>Step 1: Install Postfix and Dovecot</h3><p>I started by updating the package lists:</p><pre>sudo apt update</pre><p>Then I installed the required packages:</p><pre>sudo apt install postfix dovecot-imapd mailutils -y</pre><p>During the Postfix installation, I selected <strong>Internet Site</strong> as the configuration type and used mailserver.local as the system mail name when prompted.</p><p>Postfix handles email delivery, while Dovecot provides IMAP access to mailboxes.</p><h3>Step 2: Verify Mail Server Ports</h3><p>After installation, I checked whether the mail server services were listening on their expected ports.</p><pre>sudo ss -lntp | grep -E &#39;:(25|143|993)\b&#39;</pre><p>The output confirmed that the services were listening on the following ports:</p><ul><li><strong>Port 25 — SMTP:</strong> Used by Postfix for SMTP mail handling.</li><li><strong>Port 143 — IMAP:</strong> Used by Dovecot for email access.</li><li><strong>Port 993 — IMAPS:</strong> Used by Dovecot for IMAP over SSL/TLS.</li></ul><p>This confirmed that the expected services were listening on my system. However, port availability alone does not verify that encrypted connections or complete email delivery are working correctly.</p><h3>Step 3: Create Local Mail Users</h3><p>Next, I created two local Linux users to test email communication.</p><p>I created the first user:</p><pre>sudo adduser alice</pre><p>Then I created the second user:</p><pre>sudo adduser bob</pre><p>These accounts provided two separate local mailboxes for testing email delivery.</p><h3>Step 4: Send a Test Email</h3><p>To verify local email delivery, I sent a test message to Alice:</p><pre>echo &quot;Hello Alice, this is a test email from the Linux mail server.&quot; | mail -s &quot;Test Email&quot; alice</pre><p>This command sends a message with the subject Test Email to the local user alice.</p><p>I then logged in as Alice and opened the mail client:</p><pre>sudo -iu alice<br>mail</pre><p>I checked the mailbox to verify that the test message had arrived.</p><p>This helped me understand how local email delivery works on a Linux system.</p><h3>Step 5: Send Email Between Local Users</h3><p>After testing email delivery to Alice, I tested communication between Alice and Bob.</p><p>I switched to Alice’s account:</p><pre>sudo -iu alice</pre><p>Then I sent an email to Bob:</p><pre>mail -s &quot;Message from Alice&quot; bob</pre><p>I entered the message body and pressed Ctrl+D on a new line to finish the message.</p><p>After that, I exited Alice’s account and opened Bob’s mailbox:</p><pre>exit<br>sudo -iu bob<br>mail</pre><p>I checked whether Bob received the message.</p><p>This test demonstrated how local users can exchange email messages through the mail server.</p><h3>Step 6: Configure Email Aliases</h3><p>Email aliases allow messages addressed to a convenient name to be redirected to another local user.</p><p>I opened the aliases configuration file:</p><pre>sudo nano /etc/aliases</pre><p>I added the following entries:</p><pre>support: alice<br>admin: bob</pre><p>These entries configure:</p><ul><li>support to redirect to Alice.</li><li>admin to redirect to Bob.</li></ul><p>I saved the file and applied the changes:</p><pre>sudo newaliases</pre><p>To test the support alias, I sent a message:</p><pre>echo &quot;This email was sent to the support alias.&quot; | mail -s &quot;Alias Test&quot; support</pre><p>I then checked Alice’s mailbox to verify that the message addressed to support was delivered to her.</p><p>This demonstrated how aliases can simplify email addressing and help organize mail handling.</p><h3>Step 7: Troubleshooting and Verification</h3><p>During the setup, I used Linux commands to inspect the system and verify that the mail services were running.</p><p>To check listening ports:</p><pre>sudo ss -lntp | grep -E &#39;:(25|143|993)\b&#39;</pre><p>To inspect Postfix logs on systems where /var/log/mail.log is available:</p><pre>sudo tail -n 30 /var/log/mail.log</pre><p>If that log file is unavailable, I can inspect the system journal instead:</p><pre>sudo journalctl -u postfix -n 30 --no-pager</pre><p>These commands are useful when investigating mail delivery problems and service startup issues.</p><h3>What I Learned</h3><p>Through this project, I gained practical experience with:</p><ul><li>Installing mail server packages on Ubuntu Linux.</li><li>Understanding the roles of Postfix and Dovecot.</li><li>Creating local Linux user accounts.</li><li>Sending and reading email using command-line tools.</li><li>Testing local email delivery between users.</li><li>Configuring and applying email aliases.</li><li>Checking network listening ports.</li><li>Using service logs to investigate potential problems.</li></ul><p>The project also helped me understand how multiple Linux services work together to provide email functionality.</p><h3>Conclusion</h3><p>Setting up a local mail server using Postfix and Dovecot was a valuable hands-on Linux administration exercise. It allowed me to move beyond theory and practise configuring services, managing users, testing email delivery, and working with configuration files.</p><p>This project is part of my ongoing journey to improve my Linux, system administration, and DevOps skills.</p><p>My next step is to explore more advanced mail server configuration, including secure authentication, TLS certificates, and email access through a graphical mail client.</p><p><strong>One project at a time, one skill at a time.</strong></p><p>#Linux #Ubuntu #Postfix #Dovecot #DevOps #LinuxAdministration #SystemAdministration #LearningByDoing</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=670d5c625ac4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>