<?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 Gyanendrarokaya on Medium]]></title>
        <description><![CDATA[Stories by Gyanendrarokaya on Medium]]></description>
        <link>https://medium.com/@gyanendrarokaya18?source=rss-c1b21bfb63d2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*pyCgcZqSr2Y0Lx2u</url>
            <title>Stories by Gyanendrarokaya on Medium</title>
            <link>https://medium.com/@gyanendrarokaya18?source=rss-c1b21bfb63d2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 23:15:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gyanendrarokaya18/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[Kubernetes मा Loki + Promtail + Grafana बाट Logs Monitoring — Beginner Guide]]></title>
            <link>https://medium.com/@gyanendrarokaya18/kubernetes-%E0%A4%AE%E0%A4%BE-loki-promtail-grafana-%E0%A4%AC%E0%A4%BE%E0%A4%9F-logs-monitoring-beginner-guide-1267058fff59?source=rss-c1b21bfb63d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1267058fff59</guid>
            <dc:creator><![CDATA[Gyanendrarokaya]]></dc:creator>
            <pubDate>Mon, 21 Sep 2026 08:04:56 GMT</pubDate>
            <atom:updated>2026-09-21T08:04:56.015Z</atom:updated>
            <content:encoded><![CDATA[<p>DevOps सिक्दै गर्दा एउटा important कुरा हो — <strong>application र Kubernetes मा के भइरहेको छ भनेर logs हेर्न सक्नु।</strong></p><p>Kubernetes मा धेरै pods र services हुन्छन्। कुनै application fail भयो भने terminal मा मात्र logs हेरेर बस्नु practical हुँदैन।</p><p>त्यसैले हामी प्रयोग गर्न सक्छौँ:</p><ul><li><strong>Loki</strong> → logs store गर्ने</li><li><strong>Promtail</strong> → Kubernetes बाट logs collect गरेर Loki मा पठाउने</li><li><strong>Grafana</strong> → logs हेर्ने र visualize गर्ने</li></ul><p>यसलाई simple भाषामा:</p><pre>Kubernetes Pods<br>      ↓<br>   Promtail<br>      ↓<br>     Loki<br>      ↓<br>   Grafana<br>      ↓<br>   Logs देखिने</pre><p>यो setup मैले AWS मा बनाएको Kubernetes cluster मा प्रयोग गरेको छु।</p><h3>1. Loki भनेको के हो?</h3><p><strong>Loki भनेको logs store र search गर्न प्रयोग हुने system हो।</strong></p><p>उदाहरणका लागि Kubernetes मा कुनै Pod ले यस्तो log निकाल्यो:</p><pre>INFO Loading incluster config...<br>INFO Application started<br>ERROR Database connection failed</pre><p>यी logs Loki मा store गर्न सकिन्छ।</p><p>पछि Grafana बाट:</p><pre>{namespace=&quot;monitoring&quot;}</pre><p>जस्तो query प्रयोग गरेर logs खोज्न सकिन्छ।</p><h3>Loki को मुख्य काम</h3><pre>Logs → Store → Search</pre><h3>2. Promtail भनेको के हो?</h3><p>Loki आफैँ Kubernetes का logs खोज्न जाँदैन।</p><p><strong>Promtail</strong> ले Kubernetes/node बाट logs collect गर्छ र Loki मा पठाउँछ।</p><p>Simple example:</p><pre>Pod<br> ↓<br>Pod को log<br> ↓<br>Promtail<br> ↓<br>Loki</pre><p>त्यसैले:</p><blockquote><strong><em>Promtail = Log collector</em></strong>3. Grafana भनेको के हो?</blockquote><blockquote>Loki मा logs भए पनि हामीलाई सजिलो interface चाहिन्छ।</blockquote><p>त्यसको लागि <strong>Grafana</strong> प्रयोग गर्छौँ।</p><p>Grafana बाट:</p><ul><li>Logs हेर्न</li><li>Search गर्न</li><li>Filter गर्न</li><li>Dashboard बनाउन</li><li>Monitoring गर्न</li></ul><p>सकिन्छ।</p><p>Simple:</p><pre>Loki = Logs को storage<br>Promtail = Logs ल्याउने<br>Grafana = Logs देखाउने</pre><h3>4. हाम्रो Kubernetes setup</h3><p>मेरो AWS lab मा:</p><pre>Kubernetes Master<br>        |<br>        | Kubernetes API<br>        |<br>Kubernetes Worker<br>        |<br>        ├── Application Pods<br>        ├── Promtail<br>        └── Node Exporter</pre><pre>Monitoring namespace<br>        |<br>        ├── Loki<br>        ├── Grafana<br>        ├── Prometheus<br>        └── Alertmanager</pre><p>Grafana लाई NodePort मार्फत browser बाट access गरिएको थियो।</p><p>उदाहरण:</p><pre>http://13.51.254.43:32001</pre><p>यहाँ:</p><pre>13.51.254.43 = Kubernetes Worker को Public IP<br>32001         = Grafana को NodePort</pre><h3>5. Kubernetes मा monitoring namespace हेर्ने</h3><p>सबैभन्दा पहिले Master server मा SSH गरौँ।</p><pre>ssh -i rajwar_devops.pem ubuntu@13.51.255.191</pre><p>त्यसपछि:</p><pre>kubectl get nodes</pre><p>यसले Kubernetes cluster का nodes देखाउँछ।</p><p>Monitoring components हेर्न:</p><pre>kubectl get pods -n monitoring</pre><p>उदाहरण:</p><pre>NAME                                      READY   STATUS<br>kube-prom-grafana-xxxxx                   3/3     Running<br>loki-0                                    1/1     Running<br>loki-promtail-xxxxx                       1/1     Running<br>prometheus-xxxxx                          2/2     Running</pre><p>यदि Running देखियो भने component चलिरहेको छ।</p><h3>6. Loki install गर्न Helm प्रयोग गर्ने</h3><p>Kubernetes मा application install गर्न <strong>Helm</strong> धेरै useful हुन्छ।</p><p>Helm install छ कि छैन:</p><pre>helm version</pre><p>यदि छैन भने Ubuntu मा:</p><pre>sudo snap install helm --classic</pre><p>Check:</p><pre>helm version</pre><h3>7. Grafana Helm repository add गर्ने</h3><p>पहिले Grafana को Helm repository add गरौँ:</p><pre>helm repo add grafana https://grafana.github.io/helm-charts</pre><p>Repository update:</p><pre>helm repo update</pre><p>अब Loki stack खोज्न:</p><pre>helm search repo grafana/loki-stack</pre><h3>8. Monitoring namespace बनाउने</h3><p>यदि monitoring namespace छैन भने:</p><pre>kubectl create namespace monitoring</pre><p>Check:</p><pre>kubectl get namespaces</pre><p>त्यहाँ:</p><pre>monitoring</pre><p>देखिन्छ।</p><h3>9. Loki values file बनाउने</h3><p>हामी Loki को configuration राख्न एउटा file बनाउन सक्छौँ:</p><pre>nano values-loki.yaml</pre><p>यसमा:</p><pre>loki:<br>  enabled: true<br>  persistence:<br>    enabled: true<br>    storageClassName: local-path<br>    size: 10Gi</pre><pre>promtail:<br>  enabled: true</pre><pre>grafana:<br>  enabled: false</pre><h3>यसको अर्थ</h3><pre>loki:<br>  enabled: true</pre><p>Loki enable गर्छ।</p><pre>persistence:<br>  enabled: true</pre><p>Loki को data persistent storage मा राख्छ।</p><pre>storageClassName: local-path</pre><p>हाम्रो Kubernetes को local-path storage प्रयोग गर्छ।</p><pre>size: 10Gi</pre><p>Loki को लागि 10 GB storage माग्छ।</p><pre>promtail:<br>  enabled: true</pre><p>Promtail enable गर्छ।</p><pre>grafana:<br>  enabled: false</pre><p>Loki chart बाट अर्को Grafana install गर्दैनौँ, किनकि हाम्रो Grafana पहिले नै kube-prometheus-stack बाट चलिरहेको छ।</p><h3>10. Loki install गर्ने</h3><p>अब:</p><pre>helm upgrade --install loki \<br>  grafana/loki-stack \<br>  -n monitoring \<br>  -f values-loki.yaml \<br>  --wait \<br>  --timeout 10m</pre><h3>Command बुझौँ</h3><pre>helm upgrade --install</pre><p>Release पहिले छ भने upgrade गर्छ, छैन भने install गर्छ।</p><pre>loki</pre><p>Release को नाम।</p><pre>grafana/loki-stack</pre><p>Helm chart।</p><pre>-n monitoring</pre><p>Monitoring namespace मा install गर्छ।</p><pre>-f values-loki.yaml</pre><p>हाम्रो configuration प्रयोग गर्छ।</p><pre>--wait</pre><p>Resources ready हुनेसम्म wait गर्छ।</p><h3>11. Loki install भयो कि भएन?</h3><pre>kubectl get pods -n monitoring</pre><p>हामीले खोज्ने:</p><pre>loki-0                    1/1   Running<br>loki-promtail-xxxxx       1/1   Running<br>loki-promtail-xxxxx       1/1   Running</pre><p>Loki मात्र हेर्न:</p><pre>kubectl get pods -n monitoring | grep loki</pre><h3>12. Loki Service हेर्ने</h3><pre>kubectl get svc -n monitoring | grep loki</pre><p>उदाहरण:</p><pre>loki             ClusterIP    10.99.4.195    3100/TCP</pre><p>यहाँ:</p><pre>loki</pre><p>Service को नाम हो।</p><pre>3100</pre><p>Loki को port हो।</p><h3>13. Loki Pod को logs हेर्ने</h3><p>Loki को आफ्नै logs हेर्न:</p><pre>kubectl logs -n monitoring loki-0 --tail=50</pre><p>--tail=50 ले अन्तिम 50 lines मात्र देखाउँछ।</p><h3>14. Promtail check गर्ने</h3><pre>kubectl get pods -n monitoring | grep promtail</pre><p>उदाहरण:</p><pre>loki-promtail-759lk    1/1   Running<br>loki-promtail-nl5tm    1/1   Running</pre><p>दुई वटा हुनुको कारण हाम्रो cluster मा दुई nodes छन्।</p><h3>Promtail logs</h3><p>पहिले pod name:</p><pre>kubectl get pods -n monitoring | grep promtail</pre><p>त्यसपछि:</p><pre>kubectl logs -n monitoring loki-promtail-759lk --tail=50</pre><p>Pod name आफ्नो output अनुसार replace गर्नुपर्छ।</p><h3>15. Grafana मा Loki Data Source जोड्ने</h3><p>अब browser खोलौँ:</p><pre>http://13.51.254.43:32001</pre><p>Grafana मा:</p><pre>Connections<br>    ↓<br>Data sources<br>    ↓<br>Add new data source<br>    ↓<br>Loki</pre><p>Loki को URL:</p><pre>http://loki:3100</pre><p>Authentication:</p><pre>No Authentication</pre><p>त्यसपछि:</p><pre>Save &amp; test</pre><p>यदि:</p><pre>Data source successfully connected.</pre><p>आयो भने Grafana र Loki successfully connect भएका छन्।</p><h3>16. Grafana बाट Loki logs हेर्ने</h3><p>Grafana मा:</p><pre>Explore<br>   ↓<br>Data source = Loki</pre><p>अब query लेख्न सकिन्छ:</p><pre>{namespace=&quot;monitoring&quot;}</pre><p>Run query थिचेपछि monitoring namespace का logs देखिन्छन्।</p><h3>17. Kubernetes system logs हेर्ने</h3><p>Kubernetes system logs हेर्न:</p><pre>{namespace=&quot;kube-system&quot;}</pre><p>हाम्रो lab मा यसले यस्तो result दिएको थियो:</p><pre>Total: 33 logs<br>Total bytes processed: 7.39 kB</pre><p>र common labels मा:</p><pre>namespace=kube-system<br>component=etcd<br>container=etcd</pre><p>देखिएको थियो।</p><p>यसको मतलब Kubernetes system को logs पनि Promtail → Loki हुँदै Grafana मा आइरहेका छन्।</p><h3>18. Monitoring logs हेर्ने</h3><p>Grafana Explore मा:</p><pre>{namespace=&quot;monitoring&quot;}</pre><p>यसबाट:</p><ul><li>Loki</li><li>Promtail</li><li>Prometheus</li><li>Grafana</li><li>Alertmanager</li></ul><p>जस्ता monitoring components का logs हेर्न सकिन्छ।</p><p>हाम्रो lab मा यो query गर्दा:</p><pre>Total: 1.75 K logs<br>Total bytes processed: 405 kB</pre><p>जस्तो result आएको थियो।</p><p>यसले Loki logging pipeline काम गरिरहेको confirm गर्‍यो।</p><h3>19. Demo namespace किन खाली थियो?</h3><p>हामीले:</p><pre>{namespace=&quot;demo&quot;}</pre><p>चलाउँदा:</p><pre>No logs volume available</pre><p>आयो।</p><p>त्यसपछि Kubernetes मा check गर्‍यौँ:</p><pre>kubectl get pods -n demo -o wide</pre><p>Result:</p><pre>No resources found in demo namespace.</pre><p>त्यसैले problem Loki मा थिएन।</p><p>demo namespace मा कुनै Pod नै थिएन।</p><p>Simple:</p><pre>demo namespace<br>      ↓<br>No Pods<br>      ↓<br>No application logs<br>      ↓<br>Loki मा demo logs छैन</pre><h3>20. Loki मा logs आएको छ कि छैन भनेर कसरी बुझ्ने?</h3><p>सबैभन्दा simple test:</p><pre>{namespace=&quot;monitoring&quot;}</pre><p>यदि logs देखिन्छ भने:</p><pre>Promtail → Loki → Grafana</pre><p>काम गरिरहेको छ।</p><p>त्यस्तै:</p><pre>{namespace=&quot;kube-system&quot;}</pre><p>ले system logs देखाउँछ।</p><h3>21. Error logs खोज्ने</h3><p>Loki मा string search पनि गर्न सकिन्छ।</p><p>उदाहरण:</p><pre>{namespace=&quot;kube-system&quot;} |= &quot;error&quot;</pre><p>यसले kube-system का logs मध्ये error शब्द भएको logs खोज्छ।</p><p>अर्को:</p><pre>{namespace=&quot;monitoring&quot;} |= &quot;error&quot;</pre><p>यसले monitoring namespace का error-related logs खोज्छ।</p><h3>22. Specific component को logs</h3><p>यदि etcd को logs मात्र हेर्नुपर्‍यो भने:</p><pre>{namespace=&quot;kube-system&quot;, component=&quot;etcd&quot;}</pre><p>यसरी labels प्रयोग गरेर logs filter गर्न सकिन्छ।</p><h3>23. Useful Kubernetes commands</h3><h3>सबै monitoring pods</h3><pre>kubectl get pods -n monitoring</pre><h3>Monitoring services</h3><pre>kubectl get svc -n monitoring</pre><h3>Monitoring storage</h3><pre>kubectl get pvc -n monitoring</pre><h3>Loki pods</h3><pre>kubectl get pods -n monitoring | grep loki</pre><h3>Promtail pods</h3><pre>kubectl get pods -n monitoring | grep promtail</pre><h3>Grafana pod</h3><pre>kubectl get pods -n monitoring | grep grafana</pre><h3>Prometheus pod</h3><pre>kubectl get pods -n monitoring | grep prometheus</pre><h3>सबै monitoring resources</h3><pre>kubectl get pods,svc,pvc -n monitoring</pre><h3>सबै namespaces का pods</h3><pre>kubectl get pods -A</pre><h3>Kubernetes nodes</h3><pre>kubectl get nodes -o wide</pre><h3>24. Troubleshooting commands</h3><p>यदि Loki चलिरहेको छैन भने:</p><pre>kubectl get pods -n monitoring | grep loki</pre><p>फेरि:</p><pre>kubectl logs -n monitoring loki-0 --tail=100</pre><p>Promtail problem भए:</p><pre>kubectl get pods -n monitoring | grep promtail</pre><p>त्यसपछि:</p><pre>kubectl logs -n monitoring &lt;promtail-pod-name&gt; --tail=100</pre><p>Loki service:</p><pre>kubectl get svc -n monitoring loki</pre><p>Loki endpoint:</p><pre>kubectl get endpoints -n monitoring loki</pre><h3>25. Final architecture</h3><p>अन्तिममा हाम्रो complete logging architecture यस्तो भयो:</p><pre>AWS<br>                  │<br>          Kubernetes Cluster<br>                  │<br>        ┌─────────┴─────────┐<br>        │                   │<br>      Master              Worker<br>        │                   │<br>        │             Application Pods<br>        │                   │<br>        │               Container Logs<br>        │                   │<br>        │               Promtail<br>        │                   │<br>        └───────────┬───────┘<br>                    ↓<br>                  Loki<br>                    │<br>                    ↓<br>                 Grafana<br>                    │<br>                    ↓<br>              📊 Log Dashboard</pre><h3>26. Loki, Promtail र Grafana एक लाइनमा</h3><p>सबै कुरा याद राख्न यो formula पर्याप्त छ:</p><pre>Promtail = Logs collect गर्छ<br>Loki     = Logs store/search गर्छ<br>Grafana  = Logs देखाउँछ</pre><p>अर्थात्:</p><pre>Application<br>     ↓<br>Promtail<br>     ↓<br>Loki<br>     ↓<br>Grafana</pre><p>यही नै Kubernetes मा हाम्रो <strong>centralized logging pipeline</strong> हो।</p><h3>27. यो setup किन useful छ?</h3><p>मानौँ production मा 20 वटा Pods छन्।</p><p>यदि एउटा application crash भयो भने प्रत्येक server मा SSH गरेर logs खोज्नु गाह्रो हुन्छ।</p><p>तर Loki + Grafana भएपछि:</p><pre>Grafana<br>   ↓<br>Explore<br>   ↓<br>Loki<br>   ↓<br>Pod / Namespace / Container<br>   ↓<br>Logs</pre><p>बाट centralized रूपमा logs search गर्न सकिन्छ।</p><p>त्यसैले DevOps मा Loki एउटा important <strong>centralized logging tool</strong> हो।</p><h3>Conclusion</h3><p>यो project बाट हामीले practical रूपमा सिक्यौँ:</p><ul><li>Kubernetes monitoring namespace</li><li>Helm</li><li>Loki</li><li>Promtail</li><li>Grafana</li><li>Kubernetes logs</li><li>LogQL</li><li>Labels</li><li>Namespace filtering</li><li>Error searching</li><li>Centralized logging</li></ul><p>सबैभन्दा important कुरा:</p><pre>Kubernetes logs<br>      ↓<br>   Promtail<br>      ↓<br>     Loki<br>      ↓<br>   Grafana</pre><p>अब Kubernetes मा application वा system मा समस्या आउँदा <strong>logs कहाँ हेर्ने र कसरी search गर्ने</strong> भन्ने basic foundation तयार भएको छ।</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1267058fff59" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Kubernetes Cluster Deployment on AWS EC2 with Ansible]]></title>
            <link>https://medium.com/@gyanendrarokaya18/automating-kubernetes-cluster-deployment-on-aws-ec2-with-ansible-1091a2009965?source=rss-c1b21bfb63d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/1091a2009965</guid>
            <dc:creator><![CDATA[Gyanendrarokaya]]></dc:creator>
            <pubDate>Sun, 20 Sep 2026 06:38:04 GMT</pubDate>
            <atom:updated>2026-09-20T06:38:04.609Z</atom:updated>
            <content:encoded><![CDATA[<p>Building a Kubernetes cluster manually is a good way to understand how Kubernetes works, but repeating the same setup again and again can become time-consuming.</p><p>In this project, I automated the complete Kubernetes cluster setup using <strong>Ansible on AWS EC2</strong>.</p><p>The goal was simple:</p><blockquote><em>Use one Ansible server to automatically configure a Kubernetes control plane, join a worker node, deploy Nginx, and expose it through a NodePort service.</em></blockquote><p>This project helped me understand how <strong>Ansible, Kubernetes, AWS EC2, containerd, kubeadm, Flannel, and NodePort</strong> work together.</p><h3>🏗️ Project Architecture</h3><p>The final architecture looks like this:</p><pre>AWS<br>                     |<br>        +------------+------------+<br>        |            |            |<br>        v            v            v<br> Ansible Server   K8s Master   K8s Worker<br>      |               |            |<br>      |   Ansible     |            |<br>      +--------------&gt;|            |<br>                      |            |<br>                      | Kubernetes |<br>                      +-----------&gt;|<br>                                   |<br>                                   v<br>                              Nginx Pod<br>                                   |<br>                                   v<br>                              NodePort<br>                                   |<br>                                   v<br>                              HTTP Response</pre><p>I used three EC2 instances:</p><p>ServerRoleAnsible ServerAnsible Control NodeKubernetes MasterKubernetes Control PlaneKubernetes WorkerWorker Node</p><h3>☁️ AWS Infrastructure</h3><p>The project was built using AWS EC2 instances.</p><p>The Ansible server was used as the control machine. From this server, Ansible connected to the Kubernetes master and worker using SSH.</p><p>The basic flow was:</p><pre>Ansible Server<br>      |<br>      | SSH + Ansible<br>      |<br>      +------&gt; Kubernetes Master<br>      |<br>      +------&gt; Kubernetes Worker</pre><p>The private SSH key was stored on the Ansible server and excluded from Git using .gitignore.</p><p>For example:</p><pre>*.pem<br>*.key<br>.env<br>*.secret<br>*.password</pre><p>This is important because private keys should never be committed to a public GitHub repository.</p><h3>📁 Ansible Project Structure</h3><p>I organized the project using Ansible roles:</p><pre>k8s-ansible/<br>├── .gitignore<br>├── ansible.cfg<br>├── inventory.ini<br>├── group_vars/<br>│   └── all.yml<br>├── roles/<br>│   ├── app/<br>│   │   └── tasks/<br>│   │       └── main.yml<br>│   ├── common/<br>│   │   ├── handlers/<br>│   │   │   └── main.yml<br>│   │   └── tasks/<br>│   │       └── main.yml<br>│   ├── master/<br>│   │   └── tasks/<br>│   │       └── main.yml<br>│   └── worker/<br>│       └── tasks/<br>│           └── main.yml<br>└── site.yml</pre><p>Using roles made the project easier to understand and maintain.</p><h3>⚙️ Step 1 — Common Kubernetes Configuration</h3><p>The first role was the common role.</p><p>This role runs on both the Kubernetes master and worker.</p><p>It handles the basic Kubernetes requirements.</p><h3>Disable swap</h3><p>Kubernetes requires swap to be disabled for this setup.</p><p>Ansible automated:</p><pre>- name: Disable swap now<br>  command: swapoff -a</pre><p>It also updated /etc/fstab so swap would remain disabled after reboot.</p><h3>🧩 Step 2 — Configure Kernel Modules</h3><p>Kubernetes networking requires certain Linux kernel modules.</p><p>I configured:</p><pre>overlay<br>br_netfilter</pre><p>Ansible loads them automatically:</p><pre>modprobe overlay<br>modprobe br_netfilter</pre><h3>🌐 Step 3 — Configure Sysctl</h3><p>The required Kubernetes networking parameters were also configured:</p><pre>net.bridge.bridge-nf-call-iptables = 1<br>net.bridge.bridge-nf-call-ip6tables = 1<br>net.ipv4.ip_forward = 1</pre><p>This allows Linux to properly forward and process Kubernetes network traffic.</p><h3>📦 Step 4 — Install containerd</h3><p>Instead of Docker, this project uses <strong>containerd</strong> as the Kubernetes container runtime.</p><p>Ansible installs containerd and generates its configuration:</p><pre>containerd config default &gt; /etc/containerd/config.toml</pre><p>I also configured containerd to use the systemd cgroup driver:</p><pre>SystemdCgroup = true</pre><h3>☸️ Step 5 — Install Kubernetes Packages</h3><p>Ansible automatically installs:</p><pre>kubelet<br>kubeadm<br>kubectl</pre><p>These tools have different responsibilities:</p><h3>kubeadm</h3><p>Used to initialize and join the Kubernetes cluster.</p><h3>kubelet</h3><p>Runs on Kubernetes nodes and manages containers/pods.</p><h3>kubectl</h3><p>Used to communicate with and manage the Kubernetes cluster.</p><h3>👑 Step 6 — Initialize the Kubernetes Master</h3><p>The master role initializes the Kubernetes control plane using:</p><pre>kubeadm init \<br>  --pod-network-cidr=10.244.0.0/16 \<br>  --apiserver-advertise-address=&lt;MASTER_PRIVATE_IP&gt;</pre><p>The 10.244.0.0/16 network was selected for the Flannel CNI.</p><p>After initialization, Ansible automatically configured the Kubernetes configuration file for the Ubuntu user:</p><pre>/home/ubuntu/.kube/config</pre><p>This allowed commands such as:</p><pre>kubectl get nodes</pre><p>to work directly.</p><h3>🌐 Step 7 — Install Flannel CNI</h3><p>A Kubernetes cluster needs a Container Network Interface (CNI) plugin for pod-to-pod networking.</p><p>For this project, I used <strong>Flannel</strong>.</p><p>Ansible automatically applied the Flannel configuration and waited for the Flannel DaemonSet to become ready.</p><p>After successful installation:</p><pre>kubectl get pods -A</pre><p>showed the Kubernetes system components and Flannel pods running.</p><h3>👷 Step 8 — Automatically Join the Worker</h3><p>After initializing the master, Ansible generated the worker join command:</p><pre>kubeadm token create --print-join-command</pre><p>The generated command was then passed to the worker node.</p><p>This allowed the worker to automatically join the Kubernetes cluster without manually copying and pasting the command.</p><p>The final cluster contained:</p><pre>Control Plane<br>      |<br>      +---- Worker Node</pre><p>Both nodes became:</p><pre>Ready</pre><h3>🚀 Step 9 — Deploy Nginx Automatically</h3><p>Once the Kubernetes cluster was ready, I created an application role.</p><p>The application role deploys Nginx:</p><pre>kubectl create deployment nginx --image=nginx</pre><p>The Nginx pod was scheduled on the worker node.</p><p>The result could be verified using:</p><pre>kubectl get pods -o wide</pre><h3>🔌 Step 10 — Expose Nginx Using NodePort</h3><p>The Nginx deployment was exposed using a Kubernetes NodePort Service:</p><pre>kubectl expose deployment nginx \<br>  --type=NodePort \<br>  --port=80</pre><p>Kubernetes automatically assigned a NodePort.</p><p>For example:</p><pre>80:30490/TCP</pre><p>The service could then be accessed through the worker node’s public IP:</p><pre>curl http://WORKER_PUBLIC_IP:30490</pre><p>The response was the standard Nginx welcome page.</p><pre>Welcome to nginx!</pre><p>This confirmed that the complete deployment was working.</p><h3>🔄 Complete Automation Flow</h3><p>The final automation flow became:</p><pre>AWS EC2<br>   |<br>   v<br>Ansible Server<br>   |<br>   +-----------------------+<br>   |                       |<br>   v                       v<br>Kubernetes Master     Kubernetes Worker<br>   |                       ^<br>   |                       |<br>   +---- kubeadm ----------+<br>   |<br>   v<br>Flannel CNI<br>   |<br>   v<br>Nginx Deployment<br>   |<br>   v<br>NodePort Service<br>   |<br>   v<br>HTTP Request<br>   |<br>   v<br>Nginx Response</pre><h3>🧪 Verification</h3><p>After running the playbook:</p><pre>ansible-playbook site.yml</pre><p>I verified the Kubernetes nodes:</p><pre>kubectl get nodes -o wide</pre><p>The master and worker nodes were both in the Ready state.</p><p>I also verified all Kubernetes system pods:</p><pre>kubectl get pods -A</pre><p>Then I checked the Nginx deployment:</p><pre>kubectl get pods -o wide</pre><p>And the service:</p><pre>kubectl get svc nginx</pre><p>Finally, I tested the application externally:</p><pre>curl http://WORKER_PUBLIC_IP:NODEPORT</pre><p>The Nginx welcome page was returned successfully.</p><h3>🧰 Technologies Used</h3><p>The project used:</p><ul><li>AWS EC2</li><li>Ansible</li><li>Kubernetes</li><li>kubeadm</li><li>kubelet</li><li>kubectl</li><li>containerd</li><li>Flannel CNI</li><li>Nginx</li><li>Linux</li><li>Git</li><li>GitHub</li></ul><h3>📚 What I Learned</h3><p>This project gave me practical experience with several important DevOps concepts.</p><h3>1. Ansible Automation</h3><p>I learned how to use:</p><ul><li>Inventories</li><li>Variables</li><li>Roles</li><li>Tasks</li><li>Handlers</li><li>Playbooks</li><li>SSH-based automation</li></ul><h3>2.kubernetes</h3><p>I practiced:</p><ul><li>Kubernetes control plane initialization</li><li>Worker node joining</li><li>Pods</li><li>Deployments</li><li>Services</li><li>NodePort</li><li>CNI networking</li></ul><h3>3. AWS</h3><p>I worked with multiple EC2 instances and private/public networking.</p><h3>4. Linux</h3><p>I worked with:</p><ul><li>systemd</li><li>kernel modules</li><li>sysctl</li><li>swap</li><li>services</li><li>SSH</li><li>package management</li></ul><h3>5. Git and GitHub</h3><p>I also documented and pushed the complete project to GitHub.</p><h3>🔐 Security Consideration</h3><p>One important lesson from this project was keeping credentials and private keys outside the repository.</p><p>The project uses .gitignore to prevent files such as:</p><pre>*.pem<br>*.key<br>.env<br>*.secret<br>*.password</pre><p>from being committed.</p><p>This is especially important when working with public GitHub repositories.</p><h3>🎯 Final Result</h3><p>The main goal of the project was to automate Kubernetes deployment instead of manually configuring every server.</p><p>The final workflow became:</p><pre>Run Ansible Playbook<br>        |<br>        v<br>Configure Linux Nodes<br>        |<br>        v<br>Install containerd<br>        |<br>        v<br>Install Kubernetes<br>        |<br>        v<br>Initialize Master<br>        |<br>        v<br>Install Flannel<br>        |<br>        v<br>Join Worker<br>        |<br>        v<br>Deploy Nginx<br>        |<br>        v<br>Create NodePort<br>        |<br>        v<br>Access Nginx</pre><p>The entire process was successfully automated using Ansible.</p><h3>🔗 Project Repository</h3><p>The complete project is available on GitHub:</p><p><strong>k8s-ansible-deployment</strong></p><p><a href="https://github.com/gyanendrarokaya/k8s-ansible-deployment">https://github.com/gyanendrarokaya/k8s-ansible-deployment</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1091a2009965" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[TaskBoard Docker Lab — Important Commands]]></title>
            <link>https://medium.com/@gyanendrarokaya18/taskboard-docker-lab-important-commands-26493137fae3?source=rss-c1b21bfb63d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/26493137fae3</guid>
            <dc:creator><![CDATA[Gyanendrarokaya]]></dc:creator>
            <pubDate>Wed, 19 Aug 2026 15:56:59 GMT</pubDate>
            <atom:updated>2026-08-19T15:56:59.904Z</atom:updated>
            <content:encoded><![CDATA[<h3>1. Project Setup</h3><pre>cd ~<br>mkdir taskboar-app<br>cd taskboard-app</pre><p>Check location:</p><pre>pwd<br>ls -la</pre><p>Project structure:</p><pre>tree</pre><h3>2. Create Application Files</h3><h3>package.json</h3><pre>cat &gt; app/package.json &lt;&lt;&#39;EOF&#39;<br>...<br>EOF</pre><h3>server.js</h3><pre>cat &gt; app/server.js &lt;&lt;&#39;EOF&#39;<br>...<br>EOF</pre><h3>Dockerfile</h3><pre>cat &gt; app/Dockerfile &lt;&lt;&#39;EOF&#39;<br>...<br>EOF</pre><p>File content check:</p><pre>cat app/package.json<br>cat app/server.js<br>cat app/Dockerfile</pre><h3>3. Docker Volume Commands</h3><p>Create volume:</p><pre>docker volume create proof_data</pre><p>List volumes:</p><pre>docker volume ls</pre><p>Inspect volume:</p><pre>docker volume inspect proof_data</pre><p>Remove volume:</p><pre>docker volume rm proof_data</pre><h3>Run MySQL with Volume</h3><pre>docker run -d --name db1 \<br>-v proof_data:/var/lib/mysql \<br>-e MYSQL_ROOT_PASSWORD=pw mysql:8.0</pre><p>Wait:</p><pre>sleep 25</pre><p>Create database:</p><pre>docker exec db1 mysql -uroot -ppw \<br>-e &quot;CREATE DATABASE survived;&quot;</pre><p>Show databases:</p><pre>docker exec db1 mysql -uroot -ppw \<br>-e &quot;SHOW DATABASES;&quot;</pre><p>Delete container:</p><pre>docker rm -f db1</pre><p>Create new container using same volume:</p><pre>docker run -d --name db2 \<br>-v proof_data:/var/lib/mysql \<br>-e MYSQL_ROOT_PASSWORD=pw mysql:8.0</pre><p>Check data again:</p><pre>docker exec db2 mysql -uroot -ppw \<br>-e &quot;SHOW DATABASES;&quot;</pre><h3>4. Docker Network Commands</h3><p>Create network:</p><pre>docker network create demo-net</pre><p>List networks:</p><pre>docker network ls</pre><p>Inspect network:</p><pre>docker network inspect demo-net</pre><p>Run container on custom network:</p><pre>docker run -d --name db \<br>--network demo-net \<br>-e MYSQL_ROOT_PASSWORD=pw \<br>mysql:8.0</pre><p>Test communication by container name:</p><pre>docker run --rm \<br>--network demo-net \<br>busybox ping -c 3 db</pre><p>Remove container:</p><pre>docker rm -f db</pre><p>Remove network:</p><pre>docker network rm demo-net</pre><h3>Important Concept</h3><pre>Container → Service Name → IP</pre><pre>Example:</pre><pre>app → db<br>app → rabbitmq</pre><p>IP address manually specify गर्नु पर्दैन।</p><h3>5. Dockerfile Commands</h3><p>Build image:</p><pre>docker build -t taskboard:1.0 ./app</pre><p>List images:</p><pre>docker images</pre><p>Run container:</p><pre>docker run -d \<br>--name taskboard-app \<br>-p 3000:3000 \<br>taskboard:1.0</pre><p>Stop container:</p><pre>docker stop taskboard-app</pre><p>Remove container:</p><pre>docker rm taskboard-app</pre><h3>6. Docker Compose File</h3><p>Create Compose file:</p><pre>cat &gt; docker-compose.yml &lt;&lt;&#39;EOF&#39;<br>...<br>EOF</pre><p>Validate Compose YAML:</p><pre>docker compose config</pre><h3>7. Start TaskBoard Project</h3><p>Build and start:</p><pre>docker compose up -d --build</pre><p>Start without rebuilding:</p><pre>docker compose up -d</pre><p>Check services:</p><pre>docker compose ps</pre><h3>8. Docker Compose Logs</h3><p>All logs:</p><pre>docker compose logs</pre><p>App logs:</p><pre>docker compose logs app</pre><p>Follow app logs:</p><pre>docker compose logs -f app</pre><p>Database logs:</p><pre>docker compose logs db</pre><p>RabbitMQ logs:</p><pre>docker compose logs rabbitmq</pre><p>Stop following logs:</p><pre>Ctrl + C</pre><h3>9. TaskBoard Health Check</h3><pre>curl http://localhost:3000/health</pre><p>Expected:</p><pre>{&quot;status&quot;:&quot;ok&quot;,&quot;db&quot;:&quot;ok&quot;}</pre><p>Open application:</p><pre>curl http://localhost:3000/</pre><h3>10. Add Tasks Using curl</h3><p>Add first task:</p><pre>curl -s -X POST \<br>-d &quot;title=Buy milk&quot; \<br>http://localhost:3000/add</pre><p>Add second task:</p><pre>curl -s -X POST \<br>-d &quot;title=Ship app&quot; \<br>http://localhost:3000/add</pre><p>View tasks:</p><pre>curl http://localhost:3000/</pre><h3>11. Access MySQL from Compose</h3><p>Open MySQL shell:</p><pre>docker compose exec db \<br>mysql -utaskboard_app -pAppPass123! taskboard</pre><p>Show databases:</p><pre>SHOW DATABASES;</pre><p>Show tables:</p><pre>SHOW TABLES;</pre><p>Show tasks:</p><pre>SELECT * FROM tasks;</pre><p>Exit MySQL:</p><pre>exit;</pre><h3>12. Database Persistence Test 🔥</h3><p>Stop and remove containers:</p><pre>docker compose down</pre><p>Start again:</p><pre>docker compose up -d</pre><p>Wait:</p><pre>sleep 40</pre><p>Check tasks:</p><pre>curl http://localhost:3000/</pre><h3>Important</h3><pre>docker compose down</pre><p>ले volume delete गर्दैन।</p><p>तर:</p><pre>docker compose down -v</pre><p>ले volume पनि delete गर्छ।</p><h3>13. Docker Compose Restart Commands</h3><p>Restart services:</p><pre>docker compose restart</pre><p>Restart only app:</p><pre>docker compose restart app</pre><p>Rebuild app:</p><pre>docker compose build app</pre><p>Rebuild and restart:</p><pre>docker compose up -d --build</pre><h3>14. Docker Container Commands</h3><p>Running containers:</p><pre>docker ps</pre><p>All containers:</p><pre>docker ps -a</pre><p>Stop container:</p><pre>docker stop CONTAINER_NAME</pre><p>Start container:</p><pre>docker start CONTAINER_NAME</pre><p>Restart container:</p><pre>docker restart CONTAINER_NAME</pre><p>Remove container:</p><pre>docker rm CONTAINER_NAME</pre><p>Force remove:</p><pre>docker rm -f CONTAINER_NAME</pre><p>Execute command inside container:</p><pre>docker exec CONTAINER_NAME COMMAND</pre><p>Open shell:</p><pre>docker exec -it CONTAINER_NAME sh</pre><h3>15. Docker Image Commands</h3><p>List images:</p><pre>docker images</pre><p>Pull image:</p><pre>docker pull mysql:8.0</pre><p>Remove image:</p><pre>docker rmi IMAGE_NAME</pre><p>Build image:</p><pre>docker build -t IMAGE_NAME .</pre><p>Tag image:</p><pre>docker tag IMAGE_NAME USERNAME/IMAGE_NAME:1.0</pre><h3>16. RabbitMQ</h3><p>Check RabbitMQ container:</p><pre>docker compose ps</pre><p>View logs:</p><pre>docker compose logs rabbitmq</pre><p>Dashboard:</p><pre>http://SERVER-IP:15672</pre><p>Login:</p><pre>Username: guest<br>Password: guest</pre><h3>17. Docker Network Check</h3><pre>docker network ls</pre><p>Inspect:</p><pre>docker network inspect NETWORK_NAME</pre><p>Compose project network:</p><pre>docker network ls | grep taskboard</pre><h3>18. Docker Volume Check</h3><pre>docker volume ls</pre><p>Inspect:</p><pre>docker volume inspect VOLUME_NAME</pre><h3>19. Complete Project Commands — Quick Revision</h3><pre>cd ~/taskboard</pre><pre>docker compose config</pre><pre>docker compose up -d --build</pre><pre>docker compose ps</pre><pre>docker compose logs -f app</pre><pre>curl http://localhost:3000/health</pre><pre>curl http://localhost:3000/</pre><pre>docker compose down</pre><pre>docker compose up -d</pre><pre>docker compose down -v</pre><h3>20. Most Important Commands to Remember ⭐</h3><pre>docker ps</pre><p>Running containers हेर्न।</p><pre>docker images</pre><p>Images हेर्न।</p><pre>docker volume ls</pre><p>Volumes हेर्न।</p><pre>docker network ls</pre><p>Networks हेर्न।</p><pre>docker compose up -d</pre><p>Project start गर्न।</p><pre>docker compose up -d --build</pre><p>Build गरेर project start गर्न।</p><pre>docker compose ps</pre><p>Compose services को status हेर्न।</p><pre>docker compose logs -f app</pre><p>App logs हेर्न।</p><pre>docker compose down</pre><p>Containers stop/remove गर्न, <strong>volume राखेर</strong>।</p><pre>docker compose down -v</pre><p>Containers + volumes remove गर्न, <strong>database data पनि delete हुन्छ</strong>।</p><pre>docker exec -it CONTAINER_NAME sh</pre><p>Container भित्र जान।</p><pre>docker volume inspect VOLUME_NAME</pre><p>Volume details हेर्न।</p><h3>Key Docker Concepts</h3><pre>Image      → Application को blueprint</pre><pre>Container  → Image को running instance</pre><pre>Volume     → Persistent data storage</pre><pre>Network    → Containers बीच communication</pre><pre>Compose    → Multiple containers/services manage गर्ने tool</pre><pre>Service Name → Container communication को hostname</pre><h3>Golden Rule 🔥</h3><pre>Container = Temporary</pre><pre>Volume = Persistent</pre><pre>Network = Communication</pre><pre>Compose = Multi-container management</pre><h3>TaskBoard Architecture</h3><pre>Browser<br>   ↓<br>Node.js App :3000<br>   ↓<br>MySQL (db)<br>   ↓<br>db_data Volume</pre><pre>RabbitMQ :15672</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=26493137fae3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 24 of learning DevOps:Docker]]></title>
            <link>https://medium.com/@gyanendrarokaya18/day-24-of-learning-devops-docker-aa9b4839f4e0?source=rss-c1b21bfb63d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa9b4839f4e0</guid>
            <dc:creator><![CDATA[Gyanendrarokaya]]></dc:creator>
            <pubDate>Tue, 18 Aug 2026 16:08:04 GMT</pubDate>
            <atom:updated>2026-08-18T16:08:04.162Z</atom:updated>
            <content:encoded><![CDATA[<h3>Docker Commands for DevOps Engineers: A Practical Beginner-to-Intermediate Guide</h3><p>Docker is one of the most important tools for modern DevOps engineers. It allows developers and operations teams to package applications with their dependencies and run them consistently across different environments.</p><p>In this guide, we will learn the most important Docker commands from beginner to intermediate level and apply them to a real Node.js application.</p><h3>What is Docker?</h3><p>Docker is a containerization platform that packages an application and its dependencies into a lightweight, portable container.</p><p>Instead of installing Node.js, npm packages, configuration files, and other dependencies manually on every server, we can define them in a Docker image and run the application inside a container.</p><p>A simple architecture looks like this:</p><pre>Application<br>     ↓<br> Dockerfile<br>     ↓<br> Docker Image<br>     ↓<br> Docker Container<br>     ↓<br> Running Application</pre><h3>1. Check Docker Version</h3><p>The first command to verify Docker installation is:</p><pre>docker --version</pre><p>Example:</p><pre>Docker version 28.x.x</pre><p>You can also get more detailed information:</p><pre>docker info</pre><h3>2. Docker Help</h3><p>Docker provides built-in documentation through the command line.</p><pre>docker --help</pre><p>For a specific command:</p><pre>docker run --help</pre><p>This is extremely useful when learning Docker commands.</p><h3>3. Docker Images</h3><p>A Docker image is a read-only template used to create containers.</p><h3>List Docker Images</h3><pre>docker images</pre><p>Example:</p><pre>REPOSITORY     TAG       IMAGE ID       SIZE<br>nginx          alpine    abc123         50MB<br>node           20        xyz456         180MB</pre><p>You can also use:</p><pre>docker image ls</pre><h3>4. Pull an Image</h3><p>To download an image from Docker Hub:</p><pre>docker pull nginx:alpine</pre><p>For Node.js:</p><pre>docker pull node:20-alpine</pre><p>For Ubuntu:</p><pre>docker pull ubuntu:24.04</pre><h3>5. Run Your First Container</h3><p>Run Nginx:</p><pre>docker run nginx:alpine</pre><p>This runs Nginx in the foreground.</p><p>To run it in the background:</p><pre>docker run -d nginx:alpine</pre><p>The -d option means <strong>detached mode</strong>.</p><h3>6. Give a Container a Name</h3><p>Instead of allowing Docker to generate a random container name:</p><pre>docker run -d --name web nginx:alpine</pre><p>Now the container is called:</p><pre>web</pre><h3>7. List Running Containers</h3><pre>docker ps</pre><p>Example:</p><pre>CONTAINER ID   IMAGE          STATUS       PORTS<br>abc123         nginx:alpine   Up 2 minutes 0.0.0.0:8080-&gt;80/tcp</pre><h3>8. List All Containers</h3><p>Stopped containers are not shown by docker ps.</p><p>To see everything:</p><pre>docker ps -a</pre><p>This is one of the most important troubleshooting commands.</p><h3>9. Stop a Container</h3><pre>docker stop web</pre><h3>10. Start a Stopped Container</h3><pre>docker start web</pre><h3>11. Restart a Container</h3><pre>docker restart web</pre><h3>12. Remove a Container</h3><p>First stop it:</p><pre>docker stop web</pre><p>Then remove it:</p><pre>docker rm web</pre><p>You can force remove a running container:</p><pre>docker rm -f web</pre><p>Use -f carefully because it stops and removes the container.</p><h3>13. View Container Logs</h3><p>Logs are extremely important when troubleshooting applications.</p><pre>docker logs web</pre><p>Follow logs in real time:</p><pre>docker logs -f web</pre><p>For example, when our Node.js application fails to start, this command helps identify the problem.</p><h3>14. Enter a Running Container</h3><p>To open a shell inside a container:</p><pre>docker exec -it web sh</pre><p>If Bash exists:</p><pre>docker exec -it web bash</pre><p>Inside the container you might see:</p><pre>/ #</pre><p>You can then inspect files:</p><pre>ls<br>ls -la</pre><p>To exit:</p><pre>exit</pre><h3>Important</h3><p>Docker commands such as:</p><pre>docker stop web<br>docker ps<br>docker logs web</pre><p>are normally executed from the <strong>Docker host</strong>, not from inside the container.</p><h3>15. Port Mapping</h3><p>Containers have their own network namespace.</p><p>Suppose Nginx listens on port 80 inside the container.</p><p>We can expose it on port 8081 of the host:</p><pre>docker run -d --name web -p 8081:80 nginx:alpine</pre><p>The syntax is:</p><pre>-p HOST_PORT:CONTAINER_PORT</pre><p>So:</p><pre>Host 8081 → Container 80</pre><p>Then test:</p><pre>curl http://localhost:8081</pre><h3>16. Port Conflict</h3><p>A common Docker error is:</p><pre>failed to bind host port 0.0.0.0:8080/tcp:<br>address already in use</pre><p>This means another application is already using port 8080.</p><p>To find the process:</p><pre>sudo lsof -i :8080</pre><p>For example:</p><pre>java   1413 tomcat   TCP *:http-alt (LISTEN)</pre><p>This means Tomcat is already using port 8080.</p><p>Instead of stopping Tomcat, we can use another host port:</p><pre>docker run -d --name web -p 8081:80 nginx:alpine</pre><p>Now:</p><pre>Tomcat → 8080<br>Nginx   → 8081</pre><h3>17. Inspect a Container</h3><p>To see detailed container information:</p><pre>docker inspect web</pre><p>This can show:</p><ul><li>IP address</li><li>Network</li><li>Mounts</li><li>Environment variables</li><li>Container configuration</li><li>Port mappings</li></ul><h3>18. Docker Networks</h3><p>List Docker networks:</p><pre>docker network ls</pre><p>Create a custom network:</p><pre>docker network create taskboard-network</pre><p>Run a container on that network:</p><pre>docker run -d \<br>  --name web \<br>  --network taskboard-network \<br>  nginx:alpine</pre><p>Custom Docker networks are particularly useful when connecting multiple services.</p><p>For example:</p><pre>Nginx<br>  ↓<br>Node.js<br>  ↓<br>Database</pre><h3>19. Docker Volumes</h3><p>Containers are designed to be replaceable. For persistent data, Docker volumes are commonly used.</p><p>Create a volume:</p><pre>docker volume create app-data</pre><p>List volumes:</p><pre>docker volume ls</pre><p>Run a container with a volume:</p><pre>docker run -d \<br>  --name database \<br>  -v app-data:/data \<br>  some-image</pre><p>Inspect:</p><pre>docker volume inspect app-data</pre><h3>20. Dockerfile</h3><p>A Dockerfile defines how a Docker image is built.</p><p>For a Node.js application, a simple Dockerfile can look like:</p><pre>FROM node:20-alpine</pre><pre>WORKDIR /app</pre><pre>COPY package*.json ./</pre><pre>RUN npm install</pre><pre>COPY . .</pre><pre>EXPOSE 3000</pre><pre>CMD [&quot;node&quot;, &quot;server.js&quot;]</pre><p>Let’s understand it.</p><h3>FROM</h3><pre>FROM node:20-alpine</pre><p>Defines the base image.</p><h3>WORKDIR</h3><pre>WORKDIR /app</pre><p>Sets the working directory inside the container.</p><h3>COPY</h3><pre>COPY package*.json ./</pre><p>Copies package files into the container.</p><h3>RUN</h3><pre>RUN npm install</pre><p>Installs Node.js dependencies.</p><h3>COPY</h3><pre>COPY . .</pre><p>Copies application source code.</p><h3>EXPOSE</h3><pre>EXPOSE 3000</pre><p>Documents the port used by the application.</p><h3>CMD</h3><pre>CMD [&quot;node&quot;, &quot;server.js&quot;]</pre><p>Defines the default command to start the application.</p><h3>21. Build a Docker Image</h3><p>Suppose our directory is:</p><pre>taskboard-app/<br>├── Dockerfile<br>├── package.json<br>├── server.js<br>└── public/</pre><p>Build the image:</p><pre>docker build -t taskboard:1.0 .</pre><p>Here:</p><pre>taskboard</pre><p>is the image name.</p><pre>1.0</pre><p>is the tag.</p><pre>.</pre><p>means the current directory is the build context.</p><h3>22. Verify the Image</h3><pre>docker images</pre><p>Or:</p><pre>docker images | grep taskboard</pre><p>Example:</p><pre>taskboard   1.0   83d8f9021ef5   232MB</pre><p>This confirms that the image was successfully created.</p><h3>23. Run a Custom Application Image</h3><p>If the application listens on port 3000:</p><pre>docker run -d \<br>  --name taskboard \<br>  -p 3000:3000 \<br>  taskboard:1.0</pre><p>Check:</p><pre>docker ps</pre><p>Then:</p><pre>docker logs taskboard</pre><p>Test:</p><pre>curl http://localhost:3000</pre><h3>24. Copy Files Between Host and Container</h3><p>Copy a file from host to container:</p><pre>docker cp file.txt web:/tmp/</pre><p>Copy a file from container to host:</p><pre>docker cp web:/etc/nginx/nginx.conf .</pre><p>This is useful for debugging and inspecting configuration.</p><h3>25. Execute Commands Inside a Container</h3><p>Example:</p><pre>docker exec web ls -la /usr/share/nginx/html</pre><p>Open an interactive shell:</p><pre>docker exec -it web sh</pre><p>Run a command as root:</p><pre>docker exec -it -u root web sh</pre><h3>26. Remove Docker Images</h3><p>List images:</p><pre>docker images</pre><p>Remove an image:</p><pre>docker rmi taskboard:1.0</pre><p>If the image is being used by a container, remove the container first.</p><h3>27. Docker System Cleanup</h3><p>Docker can accumulate unused containers, images, networks, and build cache.</p><p>Check Docker disk usage:</p><pre>docker system df</pre><p>Clean unused resources:</p><pre>docker system prune</pre><p>Be careful with cleanup commands on production servers.</p><h3>28. Useful Docker Command Cheat Sheet</h3><p>TaskCommandDocker versiondocker --versionDocker informationdocker infoList imagesdocker imagesPull imagedocker pull nginx:alpineRun containerdocker run nginxRun in backgrounddocker run -d nginxName containerdocker run --name web nginxList running containersdocker psList all containersdocker ps -aStop containerdocker stop webStart containerdocker start webRestart containerdocker restart webRemove containerdocker rm webForce removedocker rm -f webLogsdocker logs webFollow logsdocker logs -f webEnter containerdocker exec -it web shInspect containerdocker inspect webBuild imagedocker build -t app:1.0 .Remove imagedocker rmi app:1.0List networksdocker network lsList volumesdocker volume lsDisk usagedocker system df</p><h3>29. Real DevOps Workflow</h3><p>A typical Docker workflow looks like this:</p><pre>Developer writes application<br>           ↓<br>       Dockerfile<br>           ↓<br>    docker build<br>           ↓<br>      Docker Image<br>           ↓<br>      docker run<br>           ↓<br>    Docker Container<br>           ↓<br>       Application</pre><p>For a production DevOps environment, the workflow can become:</p><pre>GitHub<br>   ↓<br>CI/CD Pipeline<br>   ↓<br>Docker Build<br>   ↓<br>Docker Image<br>   ↓<br>Container Registry<br>   ↓<br>Production Server<br>   ↓<br>Docker Container<br>   ↓<br>Nginx<br>   ↓<br>Users</pre><h3>30. Practical TaskBoard Docker Project</h3><p>In our practical example, we created a Node.js TaskBoard application.</p><p>Project structure:</p><pre>docker-lab/<br>└── taskboard-app/<br>    ├── Dockerfile<br>    ├── package.json<br>    ├── server.js<br>    ├── public/<br>    │   └── index.html<br>    └── taskboard.nginx.conf</pre><p>We built the image using:</p><pre>docker build -t taskboard:1.0 .</pre><p>Then verified it:</p><pre>docker images | grep taskboard</pre><p>Result:</p><pre>taskboard:1.0</pre><p>This demonstrates the complete basic Docker lifecycle:</p><pre>Application<br>     ↓<br>Dockerfile<br>     ↓<br>docker build<br>     ↓<br>taskboard:1.0<br>     ↓<br>docker run<br>     ↓<br>Container</pre><h3>Conclusion</h3><p>Docker is a fundamental skill for DevOps engineers.</p><p>The most important commands to master first are:</p><pre>docker pull<br>docker images<br>docker run<br>docker ps<br>docker ps -a<br>docker stop<br>docker start<br>docker restart<br>docker rm<br>docker logs<br>docker exec<br>docker inspect<br>docker build<br>docker rmi<br>docker network<br>docker volume</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa9b4839f4e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying 10 Real-World Applications on Ubuntu: A Complete DevOps Deployment Guide]]></title>
            <link>https://medium.com/@gyanendrarokaya18/deploying-10-real-world-applications-on-ubuntu-a-complete-devops-deployment-guide-36883340ac4c?source=rss-c1b21bfb63d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/36883340ac4c</guid>
            <dc:creator><![CDATA[Gyanendrarokaya]]></dc:creator>
            <pubDate>Mon, 17 Aug 2026 13:07:54 GMT</pubDate>
            <atom:updated>2026-08-17T13:07:54.517Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 01 — Deploying Java Maven + Spring Boot on Ubuntu</h3><h3>Deploying a Java Maven + Spring Boot Application on Ubuntu — A Complete DevOps Guide</h3><h3>Introduction</h3><p>Java Spring Boot is one of the most widely used frameworks for building production-ready backend applications. In this guide, we will deploy a Spring Boot application built with Maven on an Ubuntu server.</p><p>This deployment demonstrates a basic DevOps workflow:</p><p><strong>Source Code → Maven Build → JAR → Server → Application Service → Testing</strong></p><h3>Prerequisites</h3><p>You need:</p><ul><li>Ubuntu Server</li><li>Java JDK</li><li>Maven</li><li>Git</li><li>SSH access</li><li>A Spring Boot application</li></ul><p>Check Java:</p><pre>java -version</pre><p>Check Maven:</p><pre>mvn -version</pre><h3>1. Update the Server</h3><pre>sudo apt update<br>sudo apt upgrade -y</pre><h3>2. Install Java</h3><h3>sudo apt install -y openjdk-17-jdk</h3><p>Verify:</p><pre>java -version</pre><h3>3. Install Maven</h3><pre>sudo apt install -y maven</pre><p>Verify:</p><pre>mvn -version</pre><h3>4. Clone the Application</h3><pre>git clone &lt;YOUR_REPOSITORY_URL&gt;<br>cd &lt;YOUR_PROJECT&gt;</pre><h3>5. Build the Application</h3><h3>mvn clean package</h3><pre>target/</pre><p>Check it:</p><pre>ls -lh target/</pre><h3>6. Run the Application</h3><h3>For example:</h3><pre>java -jar target/*.jar</pre><p>If the application uses port 8080, test it:</p><pre>curl http://localhost:8080</pre><h3>7. Run Spring Boot as a systemd Service</h3><p>Create a service:</p><pre>sudo nano /etc/systemd/system/springboot.service</pre><p>Example:</p><pre>[Unit]<br>Description=Spring Boot Application<br>After=network.target</pre><pre>[Service]<br>User=ubuntu<br>WorkingDirectory=/opt/springboot<br>ExecStart=/usr/bin/java -jar /opt/springboot/app.jar<br>Restart=always<br>RestartSec=5</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Reload systemd:</p><pre>sudo systemctl daemon-reload</pre><p>Enable the service:</p><pre>sudo systemctl enable springboot</pre><pre>sudo systemctl start springboot</pre><p>Check status:</p><pre>sudo systemctl status springboot</pre><h3>8. View Application Logs</h3><pre>sudo journalctl -u springboot -f</pre><h3>9. Test the Application</h3><pre>curl http://localhost:8080</pre><p>If the application responds correctly, your Spring Boot application is running successfully.</p><h3>Troubleshooting</h3><p>Check whether port 8080 is listening:</p><pre>sudo ss -tulpn | grep 8080</pre><p>Check service logs:</p><pre>sudo journalctl -u springboot --no-pager</pre><p>Check Java:</p><pre>java -version</pre><h3>Conclusion</h3><p>We successfully deployed a Java Spring Boot application using Maven on Ubuntu.</p><p>The deployment process was:</p><pre>Git<br> ↓<br>Maven<br> ↓<br>JAR<br> ↓<br>Java<br> ↓<br>systemd<br> ↓<br>Ubuntu Server</pre><p>This is a simple but important foundation for production-oriented DevOps deployment.</p><h3>Part 02 — Deploying Java Gradle + Spring Boot</h3><h3>Deploying a Java Gradle + Spring Boot Application on Ubuntu</h3><h3>Introduction</h3><p>Gradle is another popular build automation tool used in Java applications. In this tutorial, we will deploy a Spring Boot application using Gradle.</p><h3>1. Update Ubuntu</h3><pre>sudo apt update<br>sudo apt upgrade -y</pre><h3>2. Install Java</h3><pre>sudo apt install -y openjdk-17-jdk</pre><p>Verify:</p><pre>java -version</pre><h3>3. Install Git</h3><pre>sudo apt install -y git</pre><h3>4. Clone the Project</h3><pre>git clone &lt;YOUR_REPOSITORY_URL&gt;<br>cd &lt;YOUR_PROJECT&gt;</pre><h3>5. Check Gradle</h3><p>If the project contain</p><pre>gradlew<br>build.gradle<br>settings.gradle</pre><p>Make the wrapper executable:</p><pre>chmod +x gradlew</pre><h3>6. Build the Application</h3><pre>./gradlew clean build</pre><p>The JAR will normally be inside:</p><pre>build/libs/</pre><p>Check:</p><pre>ls -lh build/libs/</pre><h3>7. Run the Application</h3><pre>java -jar build/libs/*.jar</pre><p>Test:</p><pre>curl http://localhost:8080</pre><h3>8. Create a systemd Service</h3><pre>sudo nano /etc/systemd/system/springboot-gradle.service</pre><p>Example:</p><pre>[Unit]<br>Description=Spring Boot Gradle Application<br>After=network.target</pre><pre>[Service]<br>User=ubuntu<br>WorkingDirectory=/opt/springboot-gradle<br>ExecStart=/usr/bin/java -jar /opt/springboot-gradle/app.jar<br>Restart=always</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Then:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable springboot-gradle<br>sudo systemctl start springboot-gradle</pre><p>Check:</p><pre>sudo systemctl status springboot-gradle</pre><h3>Logs</h3><pre>sudo journalctl -u springboot-gradle -f</pre><h3>Conclusion</h3><p>The deployment pipeline is:</p><pre>Git<br> ↓<br>Gradle<br> ↓<br>JAR<br> ↓<br>Java<br> ↓<br>systemd<br> ↓<br>Ubuntu</pre><p>Gradle provides a powerful and flexible build system for Spring Boot applications and is commonly used in modern Java projects.</p><h3>Part 03 — Deploying Python Django</h3><h3>Deploying a Python Django Application on Ubuntu</h3><h3>Introduction</h3><p>Django is a popular Python web framework used to build secure and scalable web applications.</p><p>In this guide, we will deploy a Django application on Ubuntu using a Python virtual environment.</p><h3>1. Install Required Packages</h3><pre>sudo apt update<br>sudo apt install -y python3 python3-pip python3-venv git</pre><p>Check:</p><pre>python3 --version</pre><h3>2. Clone the Application</h3><pre>git clone &lt;YOUR_REPOSITORY_URL&gt;<br>cd &lt;YOUR_PROJECT&gt;</pre><h3>3. Create a Virtual Environment</h3><pre>python3 -m venv venv</pre><p>Activate it:</p><pre>source venv/bin/activate</pre><h3>4. Install Dependencies</h3><p>If the project contains requirements.txt:</p><pre>pip install -r requirements.txt</pre><h3>5. Run Database Migrations</h3><pre>python manage.py migrate</pre><h3>6. Collect Static Files</h3><pre>python manage.py collectstatic --noinput</pre><h3>7. Test Django</h3><pre>python manage.py runserver 0.0.0.0:8000</pre><p>Test:</p><pre>curl http://localhost:8000</pre><h3>8. Production Application Server</h3><p>A common production setup uses Gunicorn.</p><p>Install:</p><pre>pip install gunicorn</pre><p>Test:</p><pre>gunicorn --bind 0.0.0.0:8000 &lt;project_name&gt;.wsgi:application</pre><p>Replace &lt;project_name&gt; with your actual Django project module.</p><h3>9. systemd Service</h3><pre>sudo nano /etc/systemd/system/django.service</pre><p>Example:</p><pre>[Unit]<br>Description=Django Application<br>After=network.target</pre><pre>[Service]<br>User=ubuntu<br>WorkingDirectory=/opt/django<br>ExecStart=/opt/django/venv/bin/gunicorn --bind 0.0.0.0:8000 project.wsgi:application<br>Restart=always</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Then:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable --now django</pre><p>Check:</p><pre>sudo systemctl status django</pre><h3>Conclusion</h3><p>The deployment architecture is:</p><pre>Git<br> ↓<br>Python<br> ↓<br>Virtual Environment<br> ↓<br>Django<br> ↓<br>Gunicorn<br> ↓<br>systemd<br> ↓<br>Ubuntu</pre><h3>Part 04 — Deploying Python FastAPI</h3><h3>Deploying a Python FastAPI Application on Ubuntu</h3><h3>Introduction</h3><p>FastAPI is a modern Python framework designed for building high-performance APIs.</p><h3>1. Install Python</h3><pre>sudo apt update<br>sudo apt install -y python3 python3-pip python3-venv git</pre><h3>2. Clone the Project</h3><pre>git clone &lt;YOUR_REPOSITORY_URL&gt;<br>cd &lt;YOUR_PROJECT&gt;</pre><h3>3. Create Virtual Environment</h3><pre>python3 -m venv venv<br>source venv/bin/activate</pre><h3>4. Install Dependencies</h3><pre>pip install -r requirements.txt</pre><p>If FastAPI and Uvicorn are not included:</p><pre>pip install fastapi uvicorn</pre><h3>5. Run the Application</h3><p>For an application containing main.py:</p><pre>uvicorn main:app --host 0.0.0.0 --port 8000</pre><p>Test:</p><pre>curl http://localhost:8000</pre><p>FastAPI documentation is usually available at:</p><pre>http://SERVER_IP:8000/docs</pre><h3>6. systemd Service</h3><pre>sudo nano /etc/systemd/system/fastapi.service</pre><p>Example:</p><pre>[Unit]<br>Description=FastAPI Application<br>After=network.target</pre><pre>[Service]<br>User=ubuntu<br>WorkingDirectory=/opt/fastapi<br>ExecStart=/opt/fastapi/venv/bin/uvicorn main:app --host 0.0.0.0 --port 8000<br>Restart=always</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Enable and start:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable --now fastapi</pre><p>Check:</p><pre>sudo systemctl status fastapi</pre><h3>Conclusion</h3><p>FastAPI provides an excellent platform for lightweight and high-performance APIs, while systemd ensures the application automatically starts and restarts on the server.</p><h3>Part 05 — Deploying Node.js Express</h3><h3>Deploying a Node.js Express Application on Ubuntu</h3><h3>Introduction</h3><p>Node.js and Express are widely used for developing web applications and REST APIs.</p><h3>1. Install Node.js</h3><pre>sudo apt update<br>sudo apt install -y nodejs npm</pre><p>Verify:</p><pre>node --version<br>npm --version</pre><h3>2. Clone the Application</h3><pre>git clone &lt;YOUR_REPOSITORY_URL&gt;<br>cd &lt;YOUR_PROJECT&gt;</pre><h3>3. Install Dependencies</h3><pre>npm install</pre><h3>4. Run the Application</h3><p>Depending on the project:</p><pre>npm start</pre><p>or:</p><pre>node app.js</pre><p>Test:</p><pre>curl http://localhost:3000</pre><h3>5. Run with systemd</h3><p>Create:</p><pre>sudo nano /etc/systemd/system/node-express.service</pre><p>Example:</p><pre>[Unit]<br>Description=Node.js Express Application<br>After=network.target</pre><pre>[Service]<br>User=ubuntu<br>WorkingDirectory=/opt/node-express<br>ExecStart=/usr/bin/node /opt/node-express/app.js<br>Restart=always<br>Environment=NODE_ENV=production</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Start:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable --now node-express</pre><p>Check:</p><pre>sudo systemctl status node-express</pre><h3>Conclusion</h3><p>The deployment pipeline is:</p><pre>Git<br> ↓<br>npm install<br> ↓<br>Node.js<br> ↓<br>Express<br> ↓<br>systemd<br> ↓<br>Ubuntu</pre><h3>Part 06 — Deploying PHP Laravel</h3><h3>Deploying a PHP Laravel Application on Ubuntu</h3><h3>Introduction</h3><p>Laravel is a popular PHP framework for building modern web applications.</p><h3>1. Install PHP</h3><pre>sudo apt update<br>sudo apt install -y php php-cli php-mbstring php-xml php-curl php-zip php-mysql unzip git</pre><p>Check:</p><pre>php -v</pre><h3>2. Install Composer</h3><p>Install Composer using the official Composer installation procedure, then verify:</p><pre>composer --version</pre><h3>3. Clone the Laravel Project</h3><pre>git clone &lt;YOUR_REPOSITORY_URL&gt;<br>cd &lt;YOUR_PROJECT&gt;</pre><h3>4. Install Dependencies</h3><pre>composer install --no-dev --optimize-autoloader</pre><h3>5. Configure Environment</h3><pre>cp .env.example .env</pre><p>Generate the application key:</p><pre>php artisan key:generate</pre><p>Configure database and application settings inside .env.</p><h3>6. Run Migrations</h3><pre>php artisan migrate</pre><h3>7. Storage Link</h3><pre>php artisan storage:link</pre><h3>8. Test Laravel</h3><pre>php artisan serve --host=0.0.0.0 --port=8000</pre><p>Then test:</p><pre>curl http://localhost:8000</pre><h3>Production</h3><p>Laravel is commonly deployed behind Nginx with PHP-FPM.</p><p>The typical architecture is:</p><pre>Client<br> ↓<br>Nginx<br> ↓<br>PHP-FPM<br> ↓<br>Laravel<br> ↓<br>Database</pre><h3>Conclusion</h3><p>Laravel deployment introduces important DevOps concepts such as dependency management, environment configuration, database migrations, permissions, and web-server configuration.</p><h3>Part 07 — Deploying Go Gin</h3><h3>Deploying a Go Gin Application on Ubuntu</h3><h3>Introduction</h3><p>Go is known for its performance, simple deployment model, and efficient concurrency. Gin is a lightweight HTTP framework for Go.</p><h3>1. Install Go</h3><pre>sudo apt update<br>sudo apt install -y golang-go git</pre><p>Verify:</p><pre>go version</pre><h3>2. Clone the Application</h3><pre>git clone &lt;YOUR_REPOSITORY_URL&gt;<br>cd &lt;YOUR_PROJECT&gt;</pre><h3>3. Download Dependencies</h3><pre>go mod download</pre><h3>4. Build the Application</h3><pre>go build -o app .</pre><p>Check:</p><pre>ls -lh app</pre><h3>5. Run</h3><pre>./app</pre><p>Test:</p><pre>curl http://localhost:8080</pre><h3>6. systemd Service</h3><pre>sudo nano /etc/systemd/system/gin.service</pre><p>Example:</p><pre>[Unit]<br>Description=Go Gin Application<br>After=network.target</pre><pre>[Service]<br>User=ubuntu<br>WorkingDirectory=/opt/gin<br>ExecStart=/opt/gin/app<br>Restart=always</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Start:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable --now gin</pre><p>Check:</p><pre>sudo systemctl status gin</pre><h3>Conclusion</h3><p>One major advantage of Go applications is that they can be compiled into a single binary:</p><pre>Source Code<br> ↓<br>go build<br> ↓<br>Binary<br> ↓<br>systemd<br> ↓<br>Ubuntu</pre><p>This makes Go deployments simple and efficient.</p><h3>Part 08 — Deploying WordPress</h3><h3>Deploying WordPress on Ubuntu with Nginx, PHP and MySQL</h3><h3>Introduction</h3><p>WordPress is one of the most widely used content management systems. A typical production deployment uses:</p><pre>Browser<br> ↓<br>Nginx<br> ↓<br>PHP-FPM<br> ↓<br>WordPress<br> ↓<br>MySQL</pre><h3>1. Update Ubuntu</h3><pre>sudo apt update<br>sudo apt upgrade -y</pre><h3>2. Install Nginx, PHP and MySQL</h3><pre>sudo apt install -y nginx mysql-server php-fpm php-mysql php-curl php-gd php-mbstring php-xml php-zip</pre><p>Enable services:</p><pre>sudo systemctl enable --now nginx<br>sudo systemctl enable --now mysql</pre><h3>3. Create WordPress Database</h3><p>Open MySQL:</p><pre>sudo mysql</pre><p>Create a database and user:</p><pre>CREATE DATABASE wordpress;<br>CREATE USER &#39;wordpressuser&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;StrongPassword&#39;;<br>GRANT ALL PRIVILEGES ON wordpress.* TO &#39;wordpressuser&#39;@&#39;localhost&#39;;<br>FLUSH PRIVILEGES;<br>EXIT;</pre><h3>4. Download WordPress</h3><pre>cd /tmp<br>wget https://wordpress.org/latest.tar.gz<br>tar -xzf latest.tar.gz<br>sudo mv wordpress /var/www/wordpress</pre><h3>5. Configure Permissions</h3><pre>sudo chown -R www-data:www-data /var/www/wordpress</pre><h3>6. Configure Nginx</h3><p>Create a server block:</p><pre>sudo nano /etc/nginx/sites-available/wordpress</pre><p>Configure the document root and PHP-FPM handling.</p><p>Enable it:</p><pre>sudo ln -s /etc/nginx/sites-available/wordpress /etc/nginx/sites-enabled/</pre><p>Test:</p><pre>sudo nginx -t</pre><p>Reload:</p><pre>sudo systemctl reload nginx</pre><h3>7. Complete WordPress Setup</h3><p>Open your server address in a browser:</p><pre>http://SERVER_IP</pre><p>Enter the database information created earlier and complete the WordPress installation.</p><h3>Conclusion</h3><p>WordPress deployment demonstrates a classic Linux web stack:</p><pre>Nginx<br> ↓<br>PHP-FPM<br> ↓<br>WordPress<br> ↓<br>MySQL</pre><p>This project is excellent for learning Linux services, permissions, databases, web servers, and application deployment.</p><h3>Part 09 — Deploying ASP.NET</h3><h3>Deploying an ASP.NET Application on Ubuntu</h3><h3>Introduction</h3><p>ASP.NET is Microsoft’s framework for building modern web applications and APIs. ASP.NET applications can run on Linux using .NET.</p><h3>1. Install .NET</h3><p>Install the required .NET SDK/runtime version for your application.</p><p>Verify:</p><pre>dotnet --version</pre><h3>2. Clone the Project</h3><pre>git clone &lt;YOUR_REPOSITORY_URL&gt;<br>cd &lt;YOUR_PROJECT&gt;</pre><h3>3. Restore Dependencies</h3><pre>dotnet restore</pre><h3>4. Build</h3><pre>dotnet build</pre><h3>5. Publish</h3><h3>dotnet publish -c Release -o publish</h3><h3>6. Run</h3><pre>cd publish<br>dotnet &lt;YOUR_APPLICATION&gt;.dll</pre><p>Test:</p><pre>curl http://localhost:5000</pre><p>The actual port depends on the application’s configuration.</p><h3>7. Create systemd Service</h3><pre>sudo nano /etc/systemd/system/aspnet.service</pre><p>Example:</p><pre>[Unit]<br>Description=ASP.NET Application<br>After=network.target</pre><pre>[Service]<br>WorkingDirectory=/opt/aspnet<br>ExecStart=/usr/bin/dotnet /opt/aspnet/YourApp.dll<br>Restart=always<br>RestartSec=10<br>KillSignal=SIGINT<br>SyslogIdentifier=aspnet<br>User=www-data<br>Environment=ASPNETCORE_ENVIRONMENT=Production</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Start:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable --now aspnet</pre><p>Check:</p><pre>sudo systemctl status aspnet</pre><h3>Logs</h3><pre>sudo journalctl -u aspnet -f</pre><h3>Conclusion</h3><p>The deployment pipeline is:</p><pre>Git<br> ↓<br>dotnet restore<br> ↓<br>dotnet publish<br> ↓<br>ASP.NET<br> ↓<br>systemd<br> ↓<br>Ubuntu</pre><p>ASP.NET on Linux is a strong example of cross-platform application deployment.</p><h3>Part 10 — Deploying Ruby on Rails</h3><h3>Deploying a Ruby on Rails Application on Ubuntu</h3><h3>Introduction</h3><p>Ruby on Rails is a full-stack web framework known for convention over configuration and rapid application development.</p><h3>1. Install Ruby and Dependencies</h3><pre>sudo apt update<br>sudo apt install -y ruby-full build-essential git libyaml-dev</pre><p>Check:</p><pre>ruby --version</pre><h3>2. Install Bundler</h3><pre>gem install bundler</pre><p>Verify:</p><pre>bundle --version</pre><h3>3. Clone the Application</h3><pre>git clone &lt;YOUR_REPOSITORY_URL&gt;<br>cd &lt;YOUR_PROJECT&gt;</pre><h3>4. Install Ruby Dependencies</h3><pre>bundle install</pre><h3>5. Configure Database</h3><p>Configure the application’s database settings in:</p><pre>config/database.yml</pre><p>Then run:</p><pre>bin/rails db:create<br>bin/rails db:migrate</pre><h3>6. Prepare Assets</h3><p>Depending on the Rails application:</p><pre>bin/rails assets:precompile</pre><h3>7. Start Rails</h3><p>For testing:</p><pre>bin/rails server -b 0.0.0.0 -p 3000</pre><p>Test:</p><pre>curl http://localhost:3000</pre><h3>8. Production Process Management</h3><p>A Rails application can be run using an application server such as Puma and managed using systemd.</p><p>Example service:</p><pre>[Unit]<br>Description=Ruby on Rails Application<br>After=network.target</pre><pre>[Service]<br>User=ubuntu<br>WorkingDirectory=/opt/rails<br>ExecStart=/usr/local/bin/bundle exec puma -C config/puma.rb<br>Restart=always</pre><pre>[Install]<br>WantedBy=multi-user.target</pre><p>Then:</p><pre>sudo systemctl daemon-reload<br>sudo systemctl enable --now rails</pre><p>Check:</p><pre>sudo systemctl status rails</pre><h3>Logs</h3><pre>sudo journalctl -u rails -f</pre><h3>Conclusion</h3><p>The deployment pipeline is:</p><pre>Git<br> ↓<br>Ruby<br> ↓<br>Bundler<br> ↓<br>Rails<br> ↓<br>Puma<br> ↓<br>systemd<br> ↓<br>Ubuntu</pre><p>Ruby on Rails deployment teaches important concepts around Ruby dependency management, database migrations, application servers, and Linux service management.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=36883340ac4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 22 of learning DevOps:python]]></title>
            <link>https://medium.com/@gyanendrarokaya18/day-22-of-learning-devops-python-fc7798214dc0?source=rss-c1b21bfb63d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc7798214dc0</guid>
            <dc:creator><![CDATA[Gyanendrarokaya]]></dc:creator>
            <pubDate>Tue, 11 Aug 2026 16:32:58 GMT</pubDate>
            <atom:updated>2026-08-11T16:32:58.678Z</atom:updated>
            <content:encoded><![CDATA[<h3>Python 3 on Linux: A Beginner-Friendly Guide for DevOps Engineers</h3><p>Python is one of the most popular programming languages in the world. In DevOps, Python is especially useful for <strong>automation, scripting, system administration, API integration, monitoring, deployment, and cloud operations</strong>.</p><p>On Ubuntu and other Linux systems, Python 3 is commonly available through the python3 command.</p><p>In this article, we will learn how to check Python 3, install it, run Python programs, create scripts, use packages, and understand how Python can be useful in DevOps.</p><h3>What is Python 3?</h3><p>Python 3 is the modern version of the Python programming language.</p><p>Python is popular because its syntax is simple and readable. A DevOps engineer can use Python to automate repetitive tasks instead of manually running the same Linux commands again and again.</p><p>For example, instead of manually checking disk usage:</p><pre>df -h</pre><p>you can create a Python script that checks disk usage and sends an alert when the disk is almost full.</p><h3>Why Should DevOps Engineers Learn Python?</h3><p>DevOps engineers work with many technologies, including:</p><ul><li>Linux</li><li>Git</li><li>Docker</li><li>Kubernetes</li><li>AWS</li><li>Jenkins</li><li>Ansible</li><li>Terraform</li><li>Monitoring tools</li><li>CI/CD pipelines</li><li>APIs</li></ul><p>Python can connect many of these technologies together.</p><h3>Common DevOps use cases for Python</h3><p><strong>1. Automation</strong></p><p>Automate repetitive tasks such as:</p><ul><li>Creating files</li><li>Managing users</li><li>Checking services</li><li>Backing up data</li><li>Cleaning logs</li></ul><p><strong>2. System Administration</strong></p><p>Python can interact with the Linux operating system and execute commands.</p><p><strong>3. API Automation</strong></p><p>Python can communicate with cloud and DevOps APIs.</p><p><strong>4. Monitoring</strong></p><p>Python scripts can monitor:</p><ul><li>CPU usage</li><li>Memory</li><li>Disk usage</li><li>Services</li><li>Application health</li></ul><p><strong>5. Deployment</strong></p><p>Python can help automate application deployment and infrastructure tasks.</p><h3>Installing Python 3 on Ubuntu</h3><p>First, update the package list:</p><pre>sudo apt update</pre><p>Then install Python 3:</p><pre>sudo apt install python3 -y</pre><p>Check the installed version:</p><pre>python3 --version</pre><p>Example output:</p><pre>Python 3.x.x</pre><p>Your exact version may be different depending on your Ubuntu release.</p><h3>Running Python 3</h3><p>The simplest way to start Python is:</p><pre>python3</pre><p>You should see something similar to:</p><pre>Python 3.x.x<br>&gt;&gt;&gt;</pre><p>The &gt;&gt;&gt; prompt means Python is ready to execute commands.</p><p>Try:</p><pre>print(&quot;Hello, DevOps!&quot;)</pre><p>Output:</p><pre>Hello, DevOps!</pre><p>To exit Python:</p><pre>exit()</pre><p>You can also press:</p><pre>Ctrl + D</pre><h3>Creating Your First Python Program</h3><p>Create a file:</p><pre>nano hello.py</pre><p>Add:</p><pre>print(&quot;Hello, DevOps!&quot;)<br>print(&quot;Learning Python 3&quot;)</pre><p>Save the file and run:</p><pre>python3 hello.py</pre><p>Output:</p><pre>Hello, DevOps!<br>Learning Python 3</pre><p>Congratulations! You have created and executed your first Python program.</p><h3>Python Variables</h3><p>Variables are used to store information.</p><p>Example:</p><pre>name = &quot;Gyanendra&quot;<br>role = &quot;DevOps Engineer&quot;</pre><pre>print(name)<br>print(role)</pre><p>Output:</p><pre>Gyanendra<br>DevOps Engineer</pre><p>You can also combine variables:</p><pre>name = &quot;Gyanendra&quot;</pre><pre>print(&quot;Hello&quot;, name)</pre><p>Output:</p><pre>Hello Gyanendra</pre><h3>Python Data Types</h3><p>Some commonly used Python data types are:</p><p>Data TypeExampleString&quot;DevOps&quot;Integer100Float10.5BooleanTrueList[&quot;Git&quot;, &quot;Docker&quot;, &quot;AWS&quot;]Dictionary{&quot;name&quot;: &quot;Gyanendra&quot;}</p><p>Example:</p><pre>tools = [&quot;Linux&quot;, &quot;Git&quot;, &quot;Docker&quot;, &quot;AWS&quot;]</pre><pre>print(tools)</pre><h3>Using Conditions</h3><p>Python supports conditional statements using if.</p><p>Example:</p><pre>disk_usage = 85</pre><pre>if disk_usage &gt; 80:<br>    print(&quot;Warning: Disk usage is high&quot;)<br>else:<br>    print(&quot;Disk usage is normal&quot;)</pre><p>Output:</p><pre>Warning: Disk usage is high</pre><p>This type of logic is useful for DevOps monitoring scripts.</p><h3>Python Loops</h3><p>Loops allow us to repeat operations.</p><p>Example:</p><pre>tools = [&quot;Linux&quot;, &quot;Git&quot;, &quot;Docker&quot;, &quot;Kubernetes&quot;]</pre><pre>for tool in tools:<br>    print(tool)</pre><p>Output:</p><pre>Linux<br>Git<br>Docker<br>Kubernetes</pre><p>Loops are useful when you need to process multiple servers, files, containers, or services.</p><h3>Python Functions</h3><p>Functions allow us to organize reusable code.</p><p>Example:</p><pre>def greet():<br>    print(&quot;Hello DevOps Engineer!&quot;)</pre><pre>greet()</pre><p>Output:</p><pre>Hello DevOps Engineer!</pre><p>You can also pass parameters:</p><pre>def greet(name):<br>    print(&quot;Hello&quot;, name)</pre><pre>greet(&quot;Gyanendra&quot;)</pre><h3>Working with Linux Commands</h3><p>One of the most useful features for DevOps engineers is executing Linux commands from Python.</p><p>Python provides the subprocess module for this.</p><p>Example:</p><pre>import subprocess</pre><pre>result = subprocess.run(<br>    [&quot;df&quot;, &quot;-h&quot;],<br>    capture_output=True,<br>    text=True<br>)</pre><pre>print(result.stdout)</pre><p>This executes:</p><pre>df -h</pre><p>and prints the output.</p><p>This can be the foundation for building automated Linux monitoring scripts.</p><h3>Checking Disk Usage with Python</h3><p>Let’s create a simple DevOps-style script.</p><p>Create:</p><pre>nano disk_check.py</pre><p>Add:</p><pre>import shutil</pre><pre>total, used, free = shutil.disk_usage(&quot;/&quot;)</pre><pre>used_percentage = (used / total) * 100</pre><pre>print(f&quot;Disk usage: {used_percentage:.2f}%&quot;)</pre><pre>if used_percentage &gt; 80:<br>    print(&quot;WARNING: Disk usage is high!&quot;)<br>else:<br>    print(&quot;Disk usage is normal.&quot;)</pre><p>Run:</p><pre>python3 disk_check.py</pre><p>Example:</p><pre>Disk usage: 45.23%<br>Disk usage is normal.</pre><p>This is a simple example of how Python can be used for system monitoring.</p><h3>Python Packages and pip</h3><p>Python has thousands of third-party packages.</p><p>pip is commonly used to install Python packages.</p><p>Check pip:</p><pre>python3 -m pip --version</pre><p>If pip is not installed:</p><pre>sudo apt install python3-pip -y</pre><p>Then you can install packages with:</p><pre>python3 -m pip install requests</pre><p>The requests library is commonly used to communicate with HTTP APIs.</p><p>Example:</p><pre>import requests</pre><pre>response = requests.get(&quot;https://example.com&quot;)</pre><pre>print(response.status_code)</pre><h3>Virtual Environments</h3><p>When working on Python projects, virtual environments are very useful.</p><p>Install the required package:</p><pre>sudo apt install python3-venv -y</pre><p>Create a virtual environment:</p><pre>python3 -m venv venv</pre><p>Activate it:</p><pre>source venv/bin/activate</pre><p>You should see something similar to:</p><pre>(venv) user@server:~/project$</pre><p>Now Python packages installed in this environment are isolated from the system Python environment.</p><p>To deactivate:</p><pre>deactivate</pre><h3>Python Script Permissions</h3><p>Python scripts don’t necessarily need executable permissions because we can run them using:</p><pre>python3 script.py</pre><p>However, you can make a script directly executable.</p><p>First add a shebang:</p><pre>#!/usr/bin/env python3</pre><pre>print(&quot;Hello DevOps!&quot;)</pre><p>Then:</p><pre>chmod +x hello.py</pre><p>Run:</p><pre>./hello.py</pre><p>The shebang tells Linux which interpreter should execute the script.</p><h3>Python Environment Variables</h3><p>Environment variables are extremely important in DevOps.</p><p>For example:</p><pre>export APP_ENV=production</pre><p>Python can read this variable:</p><pre>import os</pre><pre>environment = os.getenv(&quot;APP_ENV&quot;)</pre><pre>print(environment)</pre><p>Output:</p><pre>production</pre><p>This approach is commonly used to keep configuration outside application code.</p><h3>Python and Docker</h3><p>Python applications can easily be containerized using Docker.</p><p>A simple Dockerfile might look like:</p><pre>FROM python:3</pre><pre>WORKDIR /app</pre><pre>COPY . .</pre><pre>CMD [&quot;python3&quot;, &quot;app.py&quot;]</pre><p>Build the image:</p><pre>docker build -t python-app .</pre><p>Run the container:</p><pre>docker run python-app</pre><p>This demonstrates how Python development and containerization can work together.</p><h3>Python in CI/CD</h3><p>Python can also be used inside CI/CD pipelines.</p><p>For example, a pipeline could:</p><ol><li>Clone a Git repository</li><li>Install Python dependencies</li><li>Run tests</li><li>Build an application</li><li>Create a Docker image</li><li>Deploy the application</li></ol><p>A simple command in a CI/CD pipeline might be:</p><pre>python3 -m pytest</pre><p>or:</p><pre>python3 app.py</pre><p>Python scripts can also automate more complicated deployment workflows.</p><h3>Useful Python Commands for DevOps</h3><p>Here are some commands worth remembering:</p><h3>Check Python version</h3><pre>python3 --version</pre><h3>Start Python shell</h3><pre>python3</pre><h3>Run a Python file</h3><pre>python3 app.py</pre><h3>Install pip</h3><pre>sudo apt install python3-pip -y</pre><h3>Install a package</h3><pre>python3 -m pip install package_name</pre><h3>Create virtual environment</h3><pre>python3 -m venv venv</pre><h3>Activate virtual environment</h3><pre>source venv/bin/activate</pre><h3>Deactivate virtual environment</h3><pre>deactivate</pre><h3>Compile Python file</h3><pre>python3 -m py_compile app.py</pre><h3>Final Thoughts</h3><p>Python is a powerful tool for DevOps engineers.</p><p>You don’t need to become a professional Python developer before using it in DevOps. Start with the fundamentals and gradually use Python to solve real infrastructure and automation problems.</p><p>The most effective way to learn is:</p><p><strong>Learn → Build → Automate → Deploy → Monitor</strong></p><p>Start with small scripts such as disk monitoring and log cleanup. Then move toward APIs, Docker, cloud automation, CI/CD, and infrastructure automation.</p><p>If you are building your DevOps career, learning <strong>Linux + Bash + Git + Python + Docker + CI/CD + Cloud + Monitoring</strong> will give you a strong practical foundation.</p><p>Keep learning, keep automating, and keep building. 🚀</p><p>#DevOps #Python #Python3 #Linux #Automation #CloudComputing #Docker #CICD #DevOpsEngineer #Programming</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc7798214dc0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 21 of learning DevOps:Gradle and Apache Tomcat 10]]></title>
            <link>https://medium.com/@gyanendrarokaya18/day-21-of-learning-devops-gradle-and-apache-tomcat-10-fd2461a009a4?source=rss-c1b21bfb63d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/fd2461a009a4</guid>
            <dc:creator><![CDATA[Gyanendrarokaya]]></dc:creator>
            <pubDate>Tue, 04 Aug 2026 07:02:33 GMT</pubDate>
            <atom:updated>2026-08-04T07:02:33.920Z</atom:updated>
            <content:encoded><![CDATA[<h3>Gradle and Apache Tomcat 10: A Complete Beginner-to-Advanced Guide</h3><h3>Introduction</h3><p>If you’re building Java web applications, you’ve probably heard of <strong>Gradle</strong> and <strong>Apache Tomcat</strong>. These two tools play different but equally important roles in the Java ecosystem.</p><ul><li><strong>Gradle</strong> automates the process of building, testing, and packaging applications.</li><li><strong>Apache Tomcat 10</strong> runs Java web applications in a production or development environment.</li></ul><p>Understanding how these tools work together is an essential skill for Java Developers, DevOps Engineers, and anyone preparing for backend development interviews.</p><p>In this guide, you’ll learn:</p><ul><li>What Gradle is</li><li>Why Gradle is used</li><li>What Apache Tomcat 10 is</li><li>Differences between Gradle and Tomcat</li><li>Installing both tools</li><li>Building a Java web application</li><li>Deploying it on Tomcat</li><li>Best practices</li><li>Common interview questions</li></ul><h3>What is Gradle?</h3><p>Gradle is an <strong>open-source build automation tool</strong> used for Java, Kotlin, Android, Spring Boot, and many other projects.</p><p>Instead of manually compiling source files, downloading libraries, running tests, and packaging applications, Gradle performs everything automatically.</p><p>Think of Gradle as your project’s <strong>automation manager</strong>.</p><p>It can:</p><ul><li>Download dependencies</li><li>Compile Java code</li><li>Run unit tests</li><li>Package applications</li><li>Generate WAR/JAR files</li><li>Execute custom tasks</li><li>Support Continuous Integration (CI)</li></ul><h3>Why Do We Need Gradle?</h3><p>Imagine you have a project containing:</p><ul><li>500 Java files</li><li>50 external libraries</li><li>Multiple developers</li><li>Automated testing</li><li>Deployment pipeline</li></ul><p>Doing everything manually would be slow and error-prone.</p><p>Gradle solves these problems by automating repetitive tasks.</p><p>Benefits include:</p><ul><li>Faster builds</li><li>Dependency management</li><li>Easy project automation</li><li>Incremental builds</li><li>Multi-project support</li><li>CI/CD integration</li></ul><h3>Gradle Architecture</h3><pre>Project<br>│<br>├── Source Code<br>│<br>├── build.gradle<br>│<br>├── settings.gradle<br>│<br>├── Dependencies<br>│<br>└── Gradle Wrapper</pre><p>The build process looks like:</p><pre>Developer</pre><pre>↓</pre><pre>Gradle</pre><pre>↓</pre><pre>Compile</pre><pre>↓</pre><pre>Test</pre><pre>↓</pre><pre>Package</pre><pre>↓</pre><pre>WAR / JAR</pre><h3>Important Gradle Files</h3><h3>build.gradle</h3><p>Contains:</p><ul><li>Plugins</li><li>Dependencies</li><li>Build configuration</li><li>Tasks</li></ul><p>Example:</p><pre>plugins {<br>    id &#39;java&#39;<br>    id &#39;war&#39;<br>}</pre><pre>repositories {<br>    mavenCentral()<br>}</pre><pre>dependencies {<br>    implementation &#39;org.springframework:spring-web:6.0.0&#39;<br>}</pre><h3>settings.gradle</h3><p>Defines the project name.</p><pre>rootProject.name = &#39;EmployeeApp&#39;</pre><h3>gradlew</h3><p>The Gradle Wrapper lets everyone use the same Gradle version without installing Gradle manually.</p><p>Run builds like:</p><pre>./gradlew build</pre><p>Windows:</p><pre>gradlew.bat build</pre><h3>Common Gradle Commands</h3><p>Compile project</p><pre>gradle build</pre><p>Clean project</p><pre>gradle clean</pre><p>Run tests</p><pre>gradle test</pre><p>Show tasks</p><pre>gradle tasks</pre><p>Generate WAR</p><pre>gradle war</pre><p>Generate JAR</p><pre>gradle jar</pre><h3>What is Apache Tomcat 10?</h3><p>Apache Tomcat is an <strong>open-source Java Servlet Container</strong> that runs Java web applications.</p><p>Tomcat implements:</p><ul><li>Jakarta Servlet</li><li>Jakarta Pages (JSP)</li><li>WebSocket</li><li>Expression Language (EL)</li></ul><p>Tomcat allows browsers to communicate with Java applications.</p><h3>Why Tomcat 10?</h3><p>Tomcat 10 supports the <strong>Jakarta EE</strong> namespace.</p><p>Older Java EE versions used:</p><pre>javax.servlet.*</pre><p>Tomcat 10 uses:</p><pre>jakarta.servlet.*</pre><p>This change is important when migrating older applications.</p><h3>Tomcat Directory Structure</h3><pre>tomcat/</pre><pre>├── bin<br>├── conf<br>├── lib<br>├── logs<br>├── temp<br>├── webapps<br>└── work</pre><h3>bin</h3><p>Startup and shutdown scripts.</p><h3>conf</h3><p>Configuration files.</p><h3>logs</h3><p>Server logs.</p><h3>webapps</h3><p>Deploy applications here.</p><h3>Starting Tomcat</h3><p>Linux</p><pre>cd apache-tomcat-10/bin</pre><pre>./startup.sh</pre><p>Stop:</p><pre>./shutdown.sh</pre><p>Windows</p><pre>startup.bat</pre><pre>shutdown.bat</pre><h3>Default Port</h3><p>Tomcat runs on</p><pre>8080</pre><p>Open</p><pre>http://localhost:8080</pre><h3>Deploying a WAR File</h3><p>Generate WAR using Gradle.</p><pre>gradle war</pre><p>Output:</p><pre>build/libs/EmployeeApp.war</pre><p>Copy to</p><pre>tomcat/webapps/</pre><p>Start Tomcat.</p><p>Visit:</p><pre>http://localhost:8080/EmployeeApp</pre><h3>Gradle vs Tomcat</h3><p>GradleTomcatBuild ToolApplication ServerCompiles CodeRuns ApplicationsDownloads DependenciesServes HTTP RequestsGenerates WAR/JARDeploys WARAutomates TasksExecutes Web Apps</p><p>A simple workflow:</p><pre>Write Code</pre><pre>↓</pre><pre>Gradle</pre><pre>↓</pre><pre>WAR File</pre><pre>↓</pre><pre>Tomcat</pre><pre>↓</pre><pre>Browser</pre><h3>Installing Gradle</h3><p>Ubuntu</p><pre>sudo apt update</pre><pre>sudo apt install gradle</pre><p>Check version</p><pre>gradle -v</pre><h3>Installing Tomcat 10</h3><p>Download Tomcat 10 from the official website and extract it.</p><p>Example:</p><pre>wget https://downloads.apache.org/tomcat/tomcat-10/v10.x/bin/apache-tomcat-10.x.x.tar.gz</pre><pre>tar -xvf apache-tomcat-10.x.x.tar.gz</pre><p>Start Tomcat:</p><pre>cd apache-tomcat-10/bin</pre><pre>./startup.sh</pre><h3>Sample Project Structure</h3><pre>EmployeeApp/</pre><pre>src/</pre><pre>main/</pre><pre>java/</pre><pre>resources/</pre><pre>webapp/</pre><pre>WEB-INF/</pre><pre>build.gradle</pre><pre>settings.gradle</pre><h3>Gradle Build Lifecycle</h3><pre>Initialization</pre><pre>↓</pre><pre>Configuration</pre><pre>↓</pre><pre>Execution</pre><p>Each phase prepares and executes the required build tasks efficiently.</p><h3>Conclusion</h3><p>Gradle and Apache Tomcat are foundational tools in Java development. Gradle streamlines the build process by automating compilation, testing, dependency management, and packaging, while Tomcat provides the runtime environment that serves Java web applications.</p><p>Mastering both tools not only improves your development workflow but also prepares you for modern DevOps practices, CI/CD pipelines, and production deployments. Whether you’re building a simple servlet application or a large enterprise system, understanding how Gradle and Tomcat work together is an invaluable skill for every Java developer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fd2461a009a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 20 of learning DevOps:Node.js Application]]></title>
            <link>https://medium.com/@gyanendrarokaya18/day-20-of-learning-devops-node-js-application-24c4de033cdc?source=rss-c1b21bfb63d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/24c4de033cdc</guid>
            <dc:creator><![CDATA[Gyanendrarokaya]]></dc:creator>
            <pubDate>Sun, 02 Aug 2026 16:44:04 GMT</pubDate>
            <atom:updated>2026-08-02T16:44:04.495Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Deploying a Node.js application to a production server is an essential skill for every backend developer and DevOps engineer. During development, you typically run your application with npm start or node app.js, but in production, you need a reliable setup that ensures your application remains online, automatically restarts after crashes, and is accessible through a web server.</p><p>In this guide, you’ll learn how to deploy a Node.js application on an Ubuntu server using:</p><ul><li>✅ Ubuntu Server</li><li>✅ Node.js</li><li>✅ PM2 (Process Manager)</li><li>✅ Nginx (Reverse Proxy)</li><li>✅ UFW Firewall</li></ul><p>By the end of this tutorial, you’ll have a production-ready deployment that can serve your application reliably.</p><h3>Architecture Overview</h3><pre>Internet<br>     │<br>     ▼<br>+----------------+<br>|     Nginx      |<br>| Reverse Proxy  |<br>+----------------+<br>         │<br>         ▼<br>+----------------+<br>|      PM2       |<br>| Process Manager|<br>+----------------+<br>         │<br>         ▼<br>+----------------+<br>| Node.js App    |<br>| Port: 3000     |<br>+----------------+</pre><h3>Prerequisites</h3><p>Before starting, make sure you have:</p><ul><li>Ubuntu 22.04 (or newer)</li><li>A non-root user with sudo privileges</li><li>A Node.js application</li><li>Basic Linux command knowledge</li></ul><h3>Step 1: Update Your Ubuntu Server</h3><p>Update your package list and installed packages.</p><pre>sudo apt update<br>sudo apt upgrade -y</pre><h3>Step 2: Install Node.js</h3><p>Install Node.js from the official repository.</p><pre>sudo apt install nodejs npm -y</pre><p>Verify the installation.</p><pre>node -v<br>npm -v</pre><p>Example output:</p><pre>v22.x.x<br>10.x.x</pre><h3>Step 3: Upload Your Node.js Project</h3><p>Clone your project.</p><pre>git clone https://github.com/yourusername/my-node-app.git</pre><p>Go inside the project.</p><pre>cd my-node-app</pre><p>Install dependencies.</p><pre>npm install</pre><p>Run the application.</p><pre>npm start</pre><p>If everything works, press:</p><pre>CTRL + C</pre><p>to stop the application.</p><h3>Step 4: Install PM2</h3><p>PM2 is a production process manager for Node.js applications.</p><p>Install it globally.</p><pre>sudo npm install -g pm2</pre><p>Verify installation.</p><pre>pm2 -v</pre><h3>Step 5: Start Your Application with PM2</h3><p>Suppose your application starts with:</p><pre>node app.js</pre><p>Run:</p><pre>pm2 start app.js</pre><p>If your entry file is:</p><pre>server.js</pre><p>Run:</p><pre>pm2 start server.js</pre><p>Or if you use npm:</p><pre>pm2 start npm -- start</pre><h3>Step 6: Check Running Applications</h3><pre>pm2 list</pre><p>Example:</p><pre>┌────┬──────────┬────────┬──────┐<br>│ id │ name     │ status │ cpu  │<br>├────┼──────────┼────────┼──────┤<br>│ 0  │ app      │ online │ 0%   │<br>└────┴──────────┴────────┴──────┘</pre><h3>Step 7: Useful PM2 Commands</h3><p>Restart application</p><pre>pm2 restart app</pre><p>Stop application</p><pre>pm2 stop app</pre><p>Delete application</p><pre>pm2 delete app</pre><p>View logs</p><pre>pm2 logs</pre><p>Monitor CPU and Memory</p><pre>pm2 monit</pre><h3>Step 8: Enable PM2 Auto Start</h3><p>Generate startup configuration.</p><pre>pm2 startup</pre><p>The command prints another command similar to:</p><pre>sudo env PATH=$PATH:/usr/bin pm2 startup systemd -u ubuntu --hp /home/ubuntu</pre><p>Run the generated command.</p><p>Then save the running processes.</p><pre>pm2 save</pre><p>Now your application will automatically start after every reboot.</p><h3>Step 9: Install Nginx</h3><p>Install Nginx.</p><pre>sudo apt install nginx -y</pre><p>Enable it.</p><pre>sudo systemctl enable nginx</pre><p>Start it.</p><pre>sudo systemctl start nginx</pre><p>Check status.</p><pre>sudo systemctl status nginx</pre><h3>Step 10: Configure Nginx as a Reverse Proxy</h3><p>Create a new configuration file.</p><pre>sudo nano /etc/nginx/sites-available/nodeapp</pre><p>Paste the following configuration.</p><pre>server {<br>    listen 80;<br>    server_name your-domain.com;</pre><pre>    location / {<br>        proxy_pass <a href="http://localhost:3000;">http://localhost:3000;</a><br>        proxy_http_version 1.1;</pre><pre>        proxy_set_header Upgrade $http_upgrade;<br>        proxy_set_header Connection &#39;upgrade&#39;;</pre><pre>        proxy_set_header Host $host;</pre><pre>        proxy_cache_bypass $http_upgrade;<br>    }<br>}</pre><p>Save the file.</p><p>Create a symbolic link.</p><pre>sudo ln -s /etc/nginx/sites-available/nodeapp /etc/nginx/sites-enabled/</pre><p>Test configuration.</p><pre>sudo nginx -t</pre><p>Reload Nginx.</p><pre>sudo systemctl reload nginx</pre><h3>Step 11: Configure Firewall</h3><p>Allow SSH.</p><pre>sudo ufw allow OpenSSH</pre><p>Allow HTTP.</p><pre>sudo ufw allow &#39;Nginx Full&#39;</pre><p>Enable firewall.</p><pre>sudo ufw enable</pre><p>Check status.</p><pre>sudo ufw status</pre><h3>Step 12: Test the Deployment</h3><p>Visit:</p><pre>http://YOUR_SERVER_IP</pre><p>or</p><pre>http://your-domain.com</pre><p>If everything is configured correctly, your Node.js application should load successfully.</p><h3>Project Structure Example</h3><pre>my-node-app/<br>│<br>├── app.js<br>├── package.json<br>├── package-lock.json<br>├── node_modules/<br>└── public/</pre><h3>Common Troubleshooting</h3><h3>Port Already in Use</h3><p>Check which process is using port 3000.</p><pre>sudo lsof -i :3000</pre><p>Kill the process if necessary.</p><pre>kill -9 PID</pre><h3>Nginx Configuration Error</h3><pre>sudo nginx -t</pre><p>Read the error carefully and fix the configuration.</p><h3>PM2 Process Not Running</h3><p>View logs.</p><pre>pm2 logs</pre><p>Restart the application.</p><pre>pm2 restart app</pre><h3>Firewall Blocking Requests</h3><p>Check firewall rules.</p><pre>sudo ufw status</pre><h3>Conclusion</h3><p>Deploying a Node.js application on Ubuntu with PM2 and Nginx provides a robust, production-ready environment. PM2 ensures your application stays online by automatically restarting it after crashes or server reboots, while Nginx acts as a high-performance reverse proxy that efficiently handles incoming traffic.</p><p>By following this guide, you’ve learned how to:</p><ul><li>Install Node.js on Ubuntu</li><li>Deploy a Node.js application</li><li>Manage the application with PM2</li><li>Configure Nginx as a reverse proxy</li><li>Secure the server with UFW</li><li>Enable automatic startup after reboot</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24c4de033cdc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 19 of learning DevOps:Message Brokers &RabbitMQ]]></title>
            <link>https://medium.com/@gyanendrarokaya18/day-18-of-learning-devops-message-rabbitmq-37e4c19a745a?source=rss-c1b21bfb63d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/37e4c19a745a</guid>
            <dc:creator><![CDATA[Gyanendrarokaya]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 11:24:31 GMT</pubDate>
            <atom:updated>2026-08-04T06:37:42.870Z</atom:updated>
            <content:encoded><![CDATA[<h3>Message Brokers &amp; RabbitMQ: A Beginner’s Guide with Essential Commands</h3><h3>What is a Message Broker?</h3><p>A <strong>Message Broker</strong> is software that transfers messages between applications or services.</p><p>Instead of Service A talking directly to Service B:</p><pre>Service A  -----------&gt;  Service B</pre><p>A message broker sits in the middle:</p><pre>Service A<br>     |<br>     v<br>+----------------+<br>| Message Broker |<br>+----------------+<br>     |<br>     v<br>Service B</pre><p>This makes communication:</p><ul><li>Reliable</li><li>Asynchronous</li><li>Scalable</li><li>Fault-tolerant</li></ul><h3>Why Do We Need a Message Broker?</h3><p>Imagine an e-commerce website.</p><p>When a customer places an order, multiple tasks must happen:</p><ul><li>Save order</li><li>Send email</li><li>Generate invoice</li><li>Update inventory</li><li>Notify shipping</li><li>Send SMS</li></ul><p>Without a message broker:</p><pre>User<br> |<br>Order Service<br> |---Email<br> |---Inventory<br> |---Shipping<br> |---SMS</pre><p>If the Email Service crashes, the Order Service may also fail.</p><p>With RabbitMQ:</p><pre>User<br> |<br>Order Service<br> |<br>RabbitMQ<br> |--------Email Service<br> |--------Inventory Service<br> |--------Shipping Service<br> |--------SMS Service</pre><p>Even if one service is down, the messages remain safely queued.</p><h3>What is RabbitMQ?</h3><p>RabbitMQ is an open-source message broker that implements the <strong>AMQP (Advanced Message Queuing Protocol)</strong>.</p><p>Features:</p><ul><li>Reliable messaging</li><li>Message acknowledgment</li><li>Queue management</li><li>High availability</li><li>Clustering</li><li>Load balancing</li><li>Dead Letter Queues</li><li>Priority Queues</li></ul><h3>RabbitMQ Architecture</h3><pre>Producer<br>    |<br>    v<br> Exchange<br>    |<br>    v<br> Queue<br>    |<br>    v<br>Consumer</pre><h3>Producer</h3><p>The application sending messages.</p><p>Example:</p><pre>Order Service</pre><h3>Exchange</h3><p>Receives messages from producers and routes them to queues.</p><h3>Queue</h3><p>Stores messages until consumers process them.</p><h3>Consumer</h3><p>Reads messages from the queue.</p><p>Example:</p><pre>Email Service</pre><h3>Exchange Types</h3><h3>1. Direct Exchange</h3><p>Routes based on an exact routing key.</p><pre>Producer<br>   |<br>Direct Exchange<br>   |<br>routing key = order<br>   |<br>Queue</pre><h3>2. Fanout Exchange</h3><p>Sends every message to all queues.</p><pre>Producer<br>   |<br>Fanout Exchange<br> /    |     \<br>Q1   Q2    Q3</pre><p>Perfect for notifications.</p><h3>3. Topic Exchange</h3><p>Uses wildcard routing.</p><p>Example:</p><pre>order.*</pre><p>Matches:</p><ul><li>order.created</li><li>order.updated</li></ul><h3>4. Headers Exchange</h3><p>Routes using message headers instead of routing keys.</p><h3>RabbitMQ Components</h3><ul><li>Producer</li><li>Exchange</li><li>Queue</li><li>Binding</li><li>Routing Key</li><li>Consumer</li></ul><h3>Installing RabbitMQ (Ubuntu)</h3><p>Update packages:</p><pre>sudo apt update</pre><p>Install Erlang:</p><pre>sudo apt install erlang -y</pre><p>Install RabbitMQ:</p><pre>sudo apt install rabbitmq-server -y</pre><p>Start service:</p><pre>sudo systemctl start rabbitmq-server</pre><p>Enable at boot:</p><pre>sudo systemctl enable rabbitmq-server</pre><p>Check status:</p><pre>sudo systemctl status rabbitmq-server</pre><h3>Enable RabbitMQ Management UI</h3><pre>sudo rabbitmq-plugins enable rabbitmq_management</pre><p>Open:</p><pre>http://localhost:15672</pre><p>Default credentials:</p><pre>Username: guest<br>Password: guest</pre><h3>Essential RabbitMQ Commands</h3><h3>Check Status</h3><pre>sudo rabbitmqctl status</pre><h3>List Users</h3><pre>sudo rabbitmqctl list_users</pre><h3>Add User</h3><pre>sudo rabbitmqctl add_user devops password123</pre><h3>Delete User</h3><pre>sudo rabbitmqctl delete_user devops</pre><h3>Change Password</h3><pre>sudo rabbitmqctl change_password devops NewPassword</pre><h3>Set Administrator</h3><pre>sudo rabbitmqctl set_user_tags devops administrator</pre><h3>Grant Permissions</h3><pre>sudo rabbitmqctl set_permissions -p / devops &quot;.*&quot; &quot;.*&quot; &quot;.*&quot;</pre><h3>List Queues</h3><pre>sudo rabbitmqctl list_queues</pre><h3>List Exchanges</h3><pre>sudo rabbitmqctl list_exchanges</pre><h3>List Bindings</h3><pre>sudo rabbitmqctl list_bindings</pre><h3>List Connections</h3><pre>sudo rabbitmqctl list_connections</pre><h3>List Channels</h3><pre>sudo rabbitmqctl list_channels</pre><h3>Stop RabbitMQ</h3><pre>sudo systemctl stop rabbitmq-server</pre><h3>Restart RabbitMQ</h3><pre>sudo systemctl restart rabbitmq-server</pre><h3>Enable Service</h3><pre>sudo systemctl enable rabbitmq-server</pre><h3>Disable Service</h3><pre>sudo systemctl disable rabbitmq-server</pre><h3>Check Logs</h3><pre>sudo journalctl -u rabbitmq-server</pre><h3>RabbitMQ Workflow</h3><pre>Producer</pre><pre>↓</pre><pre>Exchange</pre><pre>↓</pre><pre>Queue</pre><pre>↓</pre><pre>Consumer</pre><pre>↓</pre><pre>Acknowledgment</pre><h3>Real-World DevOps Use Cases</h3><p>RabbitMQ is commonly used for:</p><ul><li>Order processing</li><li>Email notifications</li><li>Payment systems</li><li>Log aggregation</li><li>Microservices communication</li><li>CI/CD event processing</li><li>IoT messaging</li><li>Chat applications</li><li>Inventory updates</li><li>Background jobs</li></ul><h3>RabbitMQ vs Apache Kafka</h3><p>FeatureRabbitMQApache KafkaProtocolAMQPCustom ProtocolSpeedHighVery HighOrderingQueue-basedPartition-basedReplay MessagesLimitedExcellentBest ForTask queuesEvent streamingLearning CurveEasierSteeper</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=37e4c19a745a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Day 18 of learning DevOps: DATABASE]]></title>
            <link>https://medium.com/@gyanendrarokaya18/day-17-of-learning-devops-database-24d4b5741824?source=rss-c1b21bfb63d2------2</link>
            <guid isPermaLink="false">https://medium.com/p/24d4b5741824</guid>
            <dc:creator><![CDATA[Gyanendrarokaya]]></dc:creator>
            <pubDate>Wed, 29 Jul 2026 06:53:34 GMT</pubDate>
            <atom:updated>2026-08-04T06:39:02.861Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*60VK4QtSgFAtU-c4SJsDFQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eTUpVJZm8kvvTmTamOnljA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*BQ-Q1FdkE7tt4ZmHZY7e3g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*hFD9sDNwZLCqLjyrwdntog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*ydYDlvFKYMG_KIVVo6t9QA.png" /></figure><h3>Database &amp; Database Normalization (NF): A Beginner’s Guide to Organizing Data Efficiently</h3><h3>Learn what databases are, why normalization matters, and how 1NF, 2NF, and 3NF help build efficient and scalable applications.</h3><h3>Introduction</h3><p>Every application we use today — whether it’s Facebook, Amazon, Netflix, or a banking system — stores massive amounts of data. Managing that data efficiently is one of the most important tasks in software development.</p><p>This is where <strong>databases</strong> come into the picture.</p><p>However, simply storing data isn’t enough. If data is poorly organized, it can lead to duplicate records, inconsistent information, and slow performance. To solve these problems, database designers use a technique called <strong>Normalization (NF)</strong>.</p><p>In this article, we’ll explore:</p><ul><li>What a database is</li><li>Types of databases</li><li>Why databases are important</li><li>What normalization means</li><li>1NF, 2NF, and 3NF with examples</li><li>Advantages and disadvantages of normalization</li><li>Best practices</li></ul><p>Let’s get started.</p><h3>What is a Database?</h3><p>A <strong>database</strong> is an organized collection of data that can be stored, managed, updated, and retrieved efficiently.</p><p>Think of a database as a digital filing cabinet where information is stored in a structured format.</p><h3>Example</h3><p>Imagine a student management system.</p><p>Student IDNameDepartmentGPA101AliceComputer Science3.8102BobInformation Technology3.5103CharlieSoftware Engineering3.9</p><p>Instead of keeping this information in notebooks or spreadsheets, a database stores it securely and allows applications to retrieve it instantly.</p><h3>Why Do We Need Databases?</h3><p>Databases provide many benefits:</p><ul><li>Store large amounts of information</li><li>Retrieve data quickly</li><li>Prevent data loss</li><li>Improve security</li><li>Support multiple users simultaneously</li><li>Reduce duplicate data</li><li>Ensure consistency</li></ul><p>Without databases, modern applications would struggle to manage information efficiently.</p><h3>Types of Databases</h3><h3>1. Relational Database (RDBMS)</h3><p>Stores data in rows and columns.</p><p>Examples:</p><ul><li>MySQL</li><li>PostgreSQL</li><li>Oracle Database</li><li>Microsoft SQL Server</li></ul><p>Uses SQL (Structured Query Language).</p><h3>2. NoSQL Database</h3><p>Designed for unstructured or semi-structured data.</p><p>Examples:</p><ul><li>MongoDB</li><li>Cassandra</li><li>Redis</li></ul><p>Commonly used in modern web applications and big data systems.</p><h3>3. Cloud Database</h3><p>Hosted on cloud platforms.</p><p>Examples include managed database services from AWS, Microsoft Azure, and Google Cloud.</p><p>Benefits include:</p><ul><li>High availability</li><li>Automatic backups</li><li>Easy scalability</li></ul><h3>What is DBMS?</h3><p>A <strong>Database Management System (DBMS)</strong> is software that manages databases.</p><p>It allows users to:</p><ul><li>Create databases</li><li>Insert records</li><li>Update information</li><li>Delete records</li><li>Search data</li><li>Control access and security</li></ul><p>Popular DBMS software includes MySQL, PostgreSQL, Oracle Database, and Microsoft SQL Server.</p><h3>What is Normalization?</h3><p><strong>Normalization</strong> is the process of organizing data in a database to reduce redundancy (duplicate data) and improve consistency.</p><p>The main goals are:</p><ul><li>Eliminate duplicate information</li><li>Improve data integrity</li><li>Simplify updates</li><li>Reduce storage waste</li><li>Make maintenance easier</li></ul><h3>Why is Normalization Important?</h3><p>Suppose a customer changes their phone number.</p><p>If the same phone number appears in multiple rows, every occurrence must be updated.</p><p>Missing even one update creates inconsistent data.</p><p>Normalization solves this by storing information only once and linking related records appropriately.</p><h3>First Normal Form (1NF)Rule</h3><ul><li>Each column contains only one value.</li><li>No repeating groups.</li><li>Every row is unique.</li></ul><h3>Before 1NF</h3><p>StudentSubjectsAliceMath, ScienceBobEnglish, History</p><p>The <strong>Subjects</strong> column contains multiple values.</p><h3>After 1NF</h3><p>StudentSubjectAliceMathAliceScienceBobEnglishBobHistory</p><p>Now every cell contains a single value.</p><h3>Second Normal Form (2NF)</h3><h3>Rule</h3><ul><li>Must already satisfy 1NF.</li><li>Remove partial dependency.</li><li>Every non-key attribute must depend on the whole primary key.</li></ul><h3>Before 2NF</h3><p>Student IDCourse IDStudent NameCourse Name101C101AliceDatabase101C102AliceNetworking</p><p>The student’s name depends only on <strong>Student ID</strong>, not on the combination of <strong>Student ID + Course ID</strong>.</p><h3>After 2NF</h3><h3>Students Table</h3><p>Student IDStudent Name101Alice</p><h3>Courses Table</h3><p>Course IDCourse NameC101DatabaseC102Networking</p><h3>Enrollment Table</h3><p>Student IDCourse ID101C101101C102</p><p>Now duplicate student information has been removed.</p><h3>Third Normal Form (3NF)Rule</h3><ul><li>Must satisfy 2NF.</li><li>Remove transitive dependency.</li><li>Non-key columns should depend only on the primary key.</li></ul><h3>Before 3NF</h3><p>Employee IDEmployee NameDepartmentManager1JohnITDavid2SarahITDavid</p><p>The <strong>Manager</strong> depends on the <strong>Department</strong>, not directly on the employee.</p><h3>After 3NF</h3><h3>Employees</h3><p>Employee IDEmployee NameDepartment1JohnIT2SarahIT</p><h3>Departments</h3><p>DepartmentManagerITDavid</p><p>The manager is stored only once.</p><h3>Benefits of Normalization</h3><ul><li>Reduces duplicate data</li><li>Saves storage space</li><li>Improves consistency</li><li>Easier maintenance</li><li>Better update performance</li><li>Reduces insertion and deletion anomalies</li><li>Improves data integrity</li></ul><h3>Disadvantages of Normalization</h3><p>Although normalization improves database design, excessive normalization has some drawbacks:</p><ul><li>More tables</li><li>More JOIN operations</li><li>More complex queries</li><li>Slightly slower read performance in some cases</li></ul><p>For applications that require very fast reads, controlled denormalization may sometimes be used.</p><p>Key Takeaways</p><p>.A database stores organized information.</p><ul><li>DBMS software manages databases.</li><li>Normalization minimizes redundancy.</li><li>1NF ensures atomic values.</li><li>2NF removes partial dependencies.</li><li>3NF removes transitive dependencies.</li><li>Well-designed databases are easier to maintain, scale, and secure.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24d4b5741824" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>