<?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 Sumit Gautam on Medium]]></title>
        <description><![CDATA[Stories by Sumit Gautam on Medium]]></description>
        <link>https://medium.com/@sumitgautam_11332?source=rss-c8ebfdda7a14------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VfPlve-kaWoaoPEl.</url>
            <title>Stories by Sumit Gautam on Medium</title>
            <link>https://medium.com/@sumitgautam_11332?source=rss-c8ebfdda7a14------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 08:20:59 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sumitgautam_11332/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[From Click-Ops to Code: Managing My Self-Hosted OpenStack Cloud with Terraform]]></title>
            <link>https://medium.com/@sumitgautam_11332/from-click-ops-to-code-managing-my-self-hosted-openstack-cloud-with-terraform-79feac498ad8?source=rss-c8ebfdda7a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/79feac498ad8</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[openstack]]></category>
            <category><![CDATA[cloud-openstack]]></category>
            <category><![CDATA[private-cloud]]></category>
            <dc:creator><![CDATA[Sumit Gautam]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 06:31:29 GMT</pubDate>
            <atom:updated>2026-07-02T10:26:47.365Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Part 2 of my homelab OpenStack series. I’d built a private cloud on a mini PC and provisioned VMs by hand. This is how I turned that entire tenant into reproducible Infrastructure as Code — and the wall I hit connecting Terraform to a self-hosted cloud.</em></p><h3>Where Part 1 Left Off</h3><p>In the <a href="https://medium.com/@sumitgautam_11332/building-a-self-hosted-openstack-private-cloud-on-a-mini-pc-behind-cgnat-no-public-ip-0aad6a80a6e9?sharedUserId=sumitgautam_11332">first post</a>, I built a full OpenStack private cloud on a single mini PC: every service in Docker via Kolla-Ansible, the dashboard public through a Cloudflare Tunnel, a Neutron router with floating IPs, and direct SSH from my laptop into a real Ubuntu VM.</p><p>But everything was built by hand. Every network, router, security group, and VM came from typing openstack ... create one command at a time. If my cloud got wiped, I&#39;d be rebuilding from memory.</p><p>That’s the “pet” model — nurse each resource individually. The next step up is the “cattle” model: <strong>describe</strong> what you want in code, and let a tool make reality match. Destroy everything, run one command, and the whole tenant rebuilds identically in about a minute.</p><p>That tool is Terraform. This post is how I codified the entire tenant — and why connecting Terraform to a <em>self-hosted</em> OpenStack was trickier than the official docs suggest.</p><h3>The Mental Model: Two Layers</h3><p>The thing that finally made this click for me: there are <strong>two completely different layers</strong> of cloud automation, and people conflate them.</p><ul><li><strong>Building the cloud itself</strong> — installing Keystone, Nova, Neutron. That was Kolla-Ansible’s job. It’s the layer AWS hides from you entirely.</li><li><strong>Using the cloud to create resources</strong> — networks, VMs, floating IPs <em>on</em> the running cloud. That’s Terraform’s job.</li></ul><p>On AWS you only ever see the second layer, because Amazon already did the first. Running your own private cloud means you’re suddenly responsible for both. Terraform talks to OpenStack’s APIs — the same ones the CLI uses — so everything I’d done manually had a direct Terraform equivalent.</p><p><strong>Key insight:</strong> the Terraform you write against OpenStack is structurally identical to Terraform against AWS, GCP, or Azure. Same init → plan → apply workflow, same HCL language — only the provider changes. Learn it once, use it everywhere.</p><h3>Setting Up (the Safe Way)</h3><p>I’m cautious about anything that could touch a working setup, so I leaned hard on Terraform’s safety features:</p><ul><li><strong>terraform plan is a dry run.</strong> It shows exactly what it <em>would</em> create/change/destroy and changes nothing. You can run it endlessly.</li><li><strong>terraform apply asks for confirmation.</strong> Nothing happens until you type yes.</li><li><strong>Terraform only manages what it created.</strong> It keeps a state file of its own resources. My hand-built VM and networks were invisible to it — it literally cannot touch what it doesn’t know about.</li></ul><p>So I named every new resource tf-* and used a different tenant CIDR (10.10.0.0/24 vs my existing 10.0.0.0/24), guaranteeing it would sit <em>alongside</em> my manual setup, never replace it.</p><h3>Install + repo skeleton</h3><pre># Terraform via HashiCorp&#39;s apt repo<br>wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg<br>echo &quot;deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main&quot; | sudo tee /etc/apt/sources.list.d/hashicorp.list<br>sudo apt update &amp;&amp; sudo apt install -y terraform</pre><pre># git-ready project folder<br>mkdir -p ~/openstack-terraform &amp;&amp; cd ~/openstack-terraform<br>git init</pre><p><strong>Critical first step — the </strong><strong>.gitignore.</strong> Terraform generates state and credential files that contain secrets and must <em>never</em> hit GitHub:</p><pre>*.tfstate<br>*.tfstate.*<br>.terraform/<br>.terraform.lock.hcl<br>*.tfvars<br>clouds.yaml</pre><p>Pushing a terraform.tfstate full of passwords is a classic, dangerous beginner mistake. Block it from line one.</p><h3>The Wall: Connecting Terraform to a Self-Hosted Cloud</h3><p>This is where I lost the most time, and it’s the part tutorials gloss over because they assume a “normal” cloud. Here’s the chain of issues I hit, in order:</p><h3>1. Wrong cloud name</h3><p>The provider reads credentials from clouds.yaml. My first error:</p><pre>Error: cloud admin does not exist in clouds.yaml</pre><p>Kolla names its cloud entry kolla-admin, not admin. Fixed the provider block to match.</p><h3>2. The public FQDN trap</h3><p>Next, terraform plan hung for a full minute then failed:</p><pre>Get &quot;http://dashboard.example.com:9696/v2.0/networks&quot;: connection error</pre><p>The problem: my clouds.yaml pointed at my <strong>public Cloudflare domain</strong>. But Cloudflare only tunnels the dashboard (ports 80/443) — <em>not</em> the OpenStack API ports like 9696 (Neutron) or 5000 (Keystone). So Terraform was trying to reach Neutron through a tunnel that has no route for it.</p><p><strong>The fix:</strong> point Terraform at the <strong>internal VIP</strong> directly. Since Terraform runs on the host, it can reach the internal endpoints with no tunnel:</p><pre># clouds.yaml<br>auth_url: http://192.168.0.250:5000</pre><h3>3. The service catalog still pointed public</h3><p>Even after fixing auth_url, it failed again on :9696 at the public domain. Why? After authenticating, Terraform asks Keystone &quot;where are the other services?&quot; via the <strong>service catalog</strong> — and the catalog had the public FQDN registered for Neutron.</p><p>Checking the endpoints confirmed it:</p><pre>openstack endpoint list --service network<br># public   → http://dashboard.example.com:9696   (the one that hangs)<br># internal → http://192.168.0.250:9696            (the one I want)</pre><p>The clean fix is <strong>endpoint overrides</strong> in the provider, forcing Terraform straight to internal URLs:</p><pre>provider &quot;openstack&quot; {<br>  cloud = &quot;kolla-admin&quot;</pre><pre>  endpoint_overrides = {<br>    &quot;identity&quot; = &quot;http://192.168.0.250:5000/v3/&quot;<br>    &quot;network&quot;  = &quot;http://192.168.0.250:9696/v2.0/&quot;<br>    &quot;compute&quot;  = &quot;http://192.168.0.250:8774/v2.1/&quot;<br>    &quot;image&quot;    = &quot;http://192.168.0.250:9292/&quot;<br>  }<br>}</pre><p><strong>Lesson:</strong> the public FQDN is for the human-facing dashboard only. Programmatic API access (Terraform, CLI) uses internal endpoints. That separation is normal and correct — but you have to wire it explicitly when the catalog defaults to public.</p><p>Once that was right, terraform plan read my existing external network and returned its ID — authenticated, talking to my cloud, creating nothing. The &quot;hello world&quot; of IaC.</p><h3>Writing the Whole Tenant as Code</h3><p>With the connection solid, I codified everything. A clean Terraform project splits into files by purpose:</p><ul><li>main.tf — provider + all resources</li><li>variables.tf — configurable inputs with defaults</li><li>outputs.tf — values printed after apply (the floating IP, an SSH command)</li></ul><p>The resources mirror exactly what I’d built by hand:</p><pre># Tenant network + subnet<br>resource &quot;openstack_networking_network_v2&quot; &quot;tenant_net&quot; {<br>  name           = &quot;tf-net&quot;<br>  admin_state_up = true<br>}</pre><pre>resource &quot;openstack_networking_subnet_v2&quot; &quot;tenant_subnet&quot; {<br>  name            = &quot;tf-subnet&quot;<br>  network_id      = openstack_networking_network_v2.tenant_net.id<br>  cidr            = &quot;10.10.0.0/24&quot;<br>  ip_version      = 4<br>  dns_nameservers = [&quot;1.1.1.1&quot;, &quot;8.8.8.8&quot;]<br>}</pre><pre># Router bridging tenant &lt;-&gt; external<br>resource &quot;openstack_networking_router_v2&quot; &quot;router&quot; {<br>  name                = &quot;tf-router&quot;<br>  external_network_id = data.openstack_networking_network_v2.external.id<br>}</pre><pre>resource &quot;openstack_networking_router_interface_v2&quot; &quot;router_iface&quot; {<br>  router_id = openstack_networking_router_v2.router.id<br>  subnet_id = openstack_networking_subnet_v2.tenant_subnet.id<br>}</pre><pre># Security group + SSH/ICMP rules, keypair, VM, floating IP...</pre><h3>The “aha” moment</h3><p>Two things make this feel like magic the first time:</p><p><strong>Dependencies are automatic.</strong> The subnet references tenant_net.id, the router references the subnet, the floating IP associates to the VM. Terraform reads these references, builds a dependency graph, and creates everything in the <em>correct order</em> — I never specify it. Run apply and you watch the keypair, security group, network, subnet, router, and router-interface all materialize in seconds, in dependency order.</p><p><strong>Helper functions.</strong> cidrhost(&quot;10.10.0.0/24&quot;, 1) computes .1 of the range. Change the CIDR once and the gateway and allocation pool follow. That&#39;s the power of code over clicking.</p><p>A terraform plan showed the full picture:</p><pre>Plan: 11 to add, 0 to change, 0 to destroy.</pre><pre>Changes to Outputs:<br>  + ssh_command   = (known after apply)<br>  + vm_floating_ip = (known after apply)</pre><p>Eleven resources — my entire tenant — defined, validated, changing nothing until I said so.</p><h3>The Bugs I Hit Applying It</h3><p>Because I was working with a current provider version, a few things had drifted from older examples:</p><p><strong>Provider version drift.</strong> The resource I first used to attach a floating IP didn’t exist anymore:</p><pre>The provider does not support resource type<br>&quot;openstack_compute_floatingip_associate_v2&quot;.</pre><p>In the v3 provider, floating IP association moved to the <em>networking</em> side. Swapped to openstack_networking_floatingip_associate_v2, which attaches via a port_id instead of an instance ID. <strong>Lesson:</strong> provider resources get renamed across major versions; the errors are precise, so fixes are quick once you know the replacement.</p><p><strong>The floating IP wouldn’t attach.</strong> Even after the swap, the association silently didn’t happen — the vm.network[0].port attribute came back empty. The robust fix was looking up the port explicitly with a data source:</p><pre>data &quot;openstack_networking_port_v2&quot; &quot;vm_port&quot; {<br>  device_id  = openstack_compute_instance_v2.vm.id<br>  network_id = openstack_networking_network_v2.tenant_net.id<br>}</pre><pre>resource &quot;openstack_networking_floatingip_associate_v2&quot; &quot;fip_assoc&quot; {<br>  floating_ip = openstack_networking_floatingip_v2.fip.address<br>  port_id     = data.openstack_networking_port_v2.vm_port.id<br>}</pre><p>This queries “which port belongs to this VM on this network” — far more reliable than the array-index attribute.</p><p><strong>Copy-paste mangling.</strong> A couple of errors came from values losing their variable {} wrapper or a URL dropping a colon (192.168.0.250.9696 instead of :9696). The lesson there: when pasting multi-line config, heredocs (cat &gt; file &lt;&lt;&#39;EOF&#39;) preserve formatting that a terminal paste sometimes mangles.</p><h3>The Payoff: Idempotency</h3><p>The moment it all clicked was a partial failure. My first apply created 10 of 11 resources, then failed on the VM (an image-name mismatch). I fixed the name and ran apply again.</p><p>Terraform didn’t recreate the 10 existing resources. It saw they already existed, left them alone, and built <em>only</em> the missing VM. That’s <strong>idempotency</strong> — re-running converges to the desired state without redoing finished work. It’s what makes Terraform safe to run over and over.</p><p>Final result: apply builds the whole tenant and prints:</p><pre>ssh_command = &quot;ssh ubuntu@192.168.0.233&quot;</pre><p>One command, ~60 seconds, the entire manual process — reproducible, version-controlled, in a git repo. And terraform destroy cleanly removes only the tf-* resources, nothing else.</p><h3>Lessons Worth Keeping</h3><ol><li><strong>Public FQDN ≠ API endpoint.</strong> Tunnels expose the dashboard; Terraform and the CLI use internal endpoints. Override them explicitly when the catalog defaults to public.</li><li><strong>Check the service catalog</strong> (openstack endpoint list) when connections hang — the URL Terraform actually uses comes from there, not just auth_url.</li><li><strong>Provider versions drift.</strong> Resources get renamed across major versions. Read the precise error, find the replacement.</li><li><strong>Use data sources for reliable lookups</strong> — vm.network[0].port can be empty; an explicit port data source isn&#39;t.</li><li><strong>.gitignore your state and credentials first.</strong> Never commit *.tfstate or clouds.yaml.</li><li><strong>plan is free and safe.</strong> Run it constantly. Name new resources distinctly (tf-*) so they sit beside, never replace, existing infra.</li><li><strong>Idempotency is the whole point.</strong> Re-running apply fixes only what&#39;s missing.</li></ol><h3>Why This Was Worth It</h3><p>I went from “I can click together a cloud” to “I can declare a cloud in code, version it, reproduce it, and destroy it on demand.” That second skill is the one that transfers directly to any cloud platform and any real infrastructure job.</p><p>The most valuable part wasn’t the working result — it was debugging the connection layer myself. Self-hosted OpenStack doesn’t hand you a clean managed endpoint like AWS does; you have to understand auth, the service catalog, and internal-vs-public routing to make Terraform work. That understanding is exactly what’s missing when you only ever consume someone else’s cloud.</p><p>Full code is on my GitHub <em>(link below)</em> — a complete, reproducible OpenStack tenant in a handful of .tf files.</p><p><em>Next up: refactoring into reusable Terraform modules and wiring it into a CI pipeline. Follow along if homelab infrastructure is your thing.</em></p><p><em>What’s the trickiest thing you’ve had to wire Terraform into? Drop it in the comments.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79feac498ad8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Self-Hosted OpenStack Private Cloud on a Mini PC (Behind CGNAT, No Public IP)]]></title>
            <link>https://medium.com/@sumitgautam_11332/building-a-self-hosted-openstack-private-cloud-on-a-mini-pc-behind-cgnat-no-public-ip-0aad6a80a6e9?source=rss-c8ebfdda7a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/0aad6a80a6e9</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[openstack-private-cloud]]></category>
            <category><![CDATA[private-cloud-hosting]]></category>
            <dc:creator><![CDATA[Sumit Gautam]]></dc:creator>
            <pubDate>Sat, 27 Jun 2026 08:54:07 GMT</pubDate>
            <atom:updated>2026-06-27T10:10:33.105Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A hobbyist’s end-to-end build log: from a bare GMKtec mini PC to a public-facing OpenStack cloud you can SSH into — including every wall I hit and how I got past it.</em></p><h3>Why I Did This</h3><p>I’d run Proxmox before and exposed services from VMs to the internet, so I understood virtualization and home networking. What I wanted was the next step up: a real <strong>cloud orchestration platform</strong> — multi-tenancy, an API, self-service provisioning — the kind of thing AWS and GCP are built on, but running on hardware sitting on my desk.</p><p>The goal was concrete:</p><ol><li>A working OpenStack private cloud on a single mini PC.</li><li>The dashboard reachable from the public internet.</li><li>The ability to provision VMs and SSH into them.</li></ol><p>I had one complication that turns out to be very common: my home internet is behind <strong>CGNAT</strong> — no public IP, no port forwarding possible. Spoiler: that didn’t stop anything. It just shaped the architecture.</p><h3>The Hardware</h3><ul><li><strong>GMKtec mini PC</strong> — Intel CPU with VT-x, <strong>32 GB RAM</strong>, <strong>1 TB NVMe</strong></li><li><strong>Two onboard NICs</strong> (one 2.5GbE, one 1GbE)</li><li>A <strong>JetKVM</strong> for out-of-band access (KVM-over-IP) — this turned out to be a lifesaver</li><li>A <strong>MacBook</strong> as my workstation</li><li>A domain managed in <strong>Cloudflare</strong></li></ul><p>32 GB RAM is genuinely the practical floor for a single-node OpenStack that still has room to run real VMs. The control plane alone eats 12–16 GB.</p><h3>Proxmox vs OpenStack: The Mental Model</h3><p>If you’re coming from Proxmox like I was, the key reframe is this: <strong>the hypervisor layer is identical (KVM/QEMU + libvirt). Everything above it is what’s different.</strong> On Proxmox you click “create VM.” On OpenStack, that same action is decomposed across services that each own one job:</p><p>What you did on Proxmox OpenStack equivalent Service Web UI / API Horizon dashboard / CLI Horizon Users &amp; permissions Tokens, projects, roles Keystone ISO / templates <strong>Cloud images</strong> (qcow2) Glance Create VM, size it Instance from a <strong>flavor</strong> Nova Bridges, NAT, VLANs Virtual networks, routers, ports Neutron Manual per-VM firewall <strong>Security groups</strong> Neutron Port-forward to a VM <strong>Floating IP</strong> (1:1 NAT) Neutron</p><p>Two things bit me coming from Proxmox, so internalize them early:</p><ul><li><strong>Cloud images, not ISOs.</strong> OpenStack boots pre-built cloud images that self-configure on first boot via cloud-init. You do <em>not</em> click through an installer. (This caused my single biggest time sink — more later.)</li><li><strong>Security groups default to deny.</strong> A new VM blocks all inbound until you explicitly open ports.</li></ul><h3>Architecture: Working Around CGNAT</h3><p>Since I had no public IP, the design splits cleanly into two planes:</p><ul><li><strong>Admin plane</strong> — me reaching the dashboard and SSHing into VMs.</li><li><strong>Service plane</strong> — public web traffic to services (future).</li></ul><p>Both reach the outside world through <strong>Cloudflare Tunnel</strong>, which dials <em>outbound</em> from my network. Because the connection originates from inside, CGNAT is irrelevant — nothing inbound needs to be routable. This is essentially the zero-trust / BeyondCorp pattern, and it’s arguably more modern than the classic “public IP + port forward” approach.</p><p>Key realization: <strong>Cloudflare Tunnel is perfect for HTTP/HTTPS (the dashboard, web services), but it cannot give a VM raw arbitrary-port public access.</strong> A true public VPS needs a real routable IP. For a homelab/POC where you reach your own VMs, tunnels + a bastion pattern are exactly right. Real multi-user VPS hosting is a hardware/IP upgrade later, not a re-learn.</p><h3>Deployment Method: Why Kolla-Ansible</h3><p>Three real options:</p><ul><li><strong>DevStack</strong> — dev/test only, explicitly not for anything you keep. Rejected.</li><li><strong>OpenStack-Ansible</strong> — production-grade but heavy and complex; wrong place to start.</li><li><strong>Kolla-Ansible</strong> — production-grade, runs every service as a <strong>Docker container</strong>, great single-node “all-in-one” support, real upgrade path.</li></ul><p>For a container-comfortable beginner who wants something real that can grow, Kolla-Ansible is the clear pick. Debugging is just docker logs.</p><h3>The Build, Step by Step</h3><h3>1. Install Ubuntu Server (the right version!)</h3><p>This is where I hit my first real lesson. My instinct was “use the newest LTS.” <strong>Wrong.</strong> OpenStack and Kolla only support specific, tested host OS + release combinations, and the matrix moves fast.</p><p>After checking the <strong>live</strong> support matrix (not a guide, not memory):</p><ul><li><strong>Ubuntu 24.04 LTS</strong> as the host</li><li><strong>Kolla-Ansible / OpenStack 2025.1 “Epoxy”</strong></li></ul><p>I initially installed 22.04 based on outdated guidance, then discovered 2024.1 had been retired to unmaintained/ and 2025.1 had <strong>dropped 22.04 support</strong>. The fix without reinstalling everything: an <strong>in-place upgrade</strong>.</p><pre>sudo apt update &amp;&amp; sudo apt upgrade -y<br>sudo apt install -y update-manager-core<br>sudo do-release-upgrade</pre><p><strong>Lesson:</strong> Always match your host OS to what the deployer officially tests <em>today</em>. “Latest” is a liability in infrastructure, not a feature.</p><p>BIOS prerequisites (do these first, via JetKVM):</p><ul><li>Enable <strong>Intel VT-x / virtualization</strong> (non-negotiable — VMs won’t run without it)</li><li>Disable <strong>Secure Boot</strong></li></ul><p>Verify virtualization after boot:</p><pre>egrep -c &#39;(vmx|svm)&#39; /proc/cpuinfo   # &gt;0 means enabled</pre><h3>2. Pin a Static IP</h3><p>Identify your NIC (modern names like eno1, not eth0):</p><pre>ip -br addr</pre><p>Set a static IP in netplan <strong>outside</strong> your router’s DHCP range, with JetKVM open in case you lock yourself out:</p><pre># /etc/netplan/00-installer-config.yaml<br>network:<br>  version: 2<br>  ethernets:<br>    eno1:<br>      dhcp4: false<br>      addresses: [192.168.0.200/24]<br>      routes:<br>        - to: default<br>          via: 192.168.0.1<br>      nameservers:<br>        addresses: [1.1.1.1, 8.8.8.8]</pre><pre>sudo netplan apply</pre><h3>3. Install Kolla-Ansible</h3><pre># host prep<br>sudo apt install -y git python3-dev libffi-dev gcc libssl-dev python3-venv python3-pip<br>sudo timedatectl set-ntp true<br> <br># isolated venv<br>python3 -m venv ~/kolla-venv<br>source ~/kolla-venv/bin/activate<br>pip install -U pip<br>pip install &#39;ansible-core&gt;=2.16&#39;<br> <br># clone the EXACT supported branch with git (more reliable than pip&#39;s git+ shallow clone)<br>cd ~<br>git clone --branch stable/2025.1 https://opendev.org/openstack/kolla-ansible<br>pip install ./kolla-ansible<br>kolla-ansible install-deps</pre><p><strong>Lesson:</strong> pip install git+...@branch does a shallow clone that can fail to find the branch. A plain git clone --branch is more reliable. And confirm the branch actually exists first: git ls-remote --heads &lt;repo&gt;.</p><h3>4. Configure globals.yml</h3><pre>sudo mkdir -p /etc/kolla &amp;&amp; sudo chown $USER:$USER /etc/kolla<br>cp -r ~/kolla-venv/share/kolla-ansible/etc_examples/kolla/* /etc/kolla/<br>cp ~/kolla-venv/share/kolla-ansible/ansible/inventory/all-in-one ~/<br>kolla-genpwd</pre><p>Key settings (single-node, single-NIC NAT to start):</p><pre>kollabasedistro: &quot;ubuntu&quot;<br>openstack_release: &quot;2025.1&quot;<br>kollainternal_vipaddress: &quot;192.168.0.250&quot;   # a SPARE LAN IP, not the host&#39;s<br>network_interface: &quot;eno1&quot;<br>neutronexternalinterface: &quot;dummy1&quot;           # see note below<br>neutronpluginagent: &quot;ovn&quot;<br>enable_haproxy: &quot;yes&quot;</pre><p><strong>The single-NIC trick:</strong> Neutron’s external interface must be a “naked” (no-IP) interface, and it must <em>not</em> be the one your host IP lives on (or you lock yourself out). With one NIC, create a dummy interface for Neutron to bridge onto so it never touches your real NIC:</p><pre>sudo ip link add dummy1 type dummy<br>sudo ip link set dummy1 up</pre><h3>5. Bootstrap → Prechecks → Deploy</h3><pre>kolla-ansible bootstrap-servers -i ~/all-in-one   # installs Docker, etc.<br>kolla-ansible prechecks -i ~/all-in-one           # validates config<br>kolla-ansible deploy -i ~/all-in-one              # pulls images, starts everything (~30 min)</pre><p>Prechecks are your friend — they fail loudly and specifically. I hit a chain of them, each a quick fix:</p><ul><li><strong>No module named &#39;docker&#39;</strong> → pip install docker</li><li><strong>No module named &#39;dbus&#39;</strong> → sudo apt install -y libdbus-1-dev libdbus-glib-1-dev pkg-config &amp;&amp; pip install dbus-python</li><li><strong>Please enable at least one backend for Cinder</strong> → I set enable_cinder: &quot;no&quot; for the POC (VMs run fine on ephemeral disk; add block storage later)</li></ul><p>Also needed <strong>passwordless sudo</strong> for the deploy user so Ansible can escalate non-interactively:</p><pre>echo &quot;$USER ALL=(ALL) NOPASSWD: ALL&quot; | sudo tee /etc/sudoers.d/$USER</pre><p>A successful run ends with failed=0. Mine: ok=449 changed=273 failed=0. 449 tasks, a full cloud, in containers.</p><h3>6. Verify</h3><pre>pip install python-openstackclient<br>kolla-ansible post-deploy -i ~/all-in-one<br>source /etc/kolla/admin-openrc.sh<br>openstack service list      # keystone, nova, neutron, glance, placement... all there</pre><p>Horizon dashboard: http://&lt;your-VIP&gt; — admin password via:</p><pre>grep keystoneadminpassword /etc/kolla/passwords.yml</pre><h3>Provisioning the First VM</h3><pre># Image — CirrOS first to test the pipeline (tiny, 16MB)<br>wget http://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img<br>openstack image create &quot;cirros&quot; --file cirros-0.6.2-x86_64-disk.img \<br>  --disk-format qcow2 --container-format bare --public<br> <br># Flavor (CPU/RAM/disk)<br>openstack flavor create --vcpus 2 --ram 2048 --disk 20 m1.small<br> <br># Private tenant network<br>openstack network create tenant-net<br>openstack subnet create tenant-subnet --network tenant-net \<br>  --subnet-range 10.0.0.0/24 --gateway 10.0.0.1 \<br>  --dns-nameserver 1.1.1.1 --allocation-pool start=10.0.0.10,end=10.0.0.200<br> <br># Security group (open SSH + ping)<br>openstack security group create vm-access<br>openstack security group rule create vm-access --protocol tcp --dst-port 22 --remote-ip 0.0.0.0/0<br>openstack security group rule create vm-access --protocol icmp --remote-ip 0.0.0.0/0<br> <br># SSH key + launch<br>openstack keypair create --public-key ~/.ssh/id_ed25519.pub mykey<br>openstack server create --image cirros --flavor m1.small \<br>  --network tenant-net --security-group vm-access --key-name mykey my-first-vm</pre><p>ACTIVE with a 10.0.0.x IP = a VM running on your own cloud. 🎉</p><h3>Networking: The Keystone Concept (Router + Floating IPs)</h3><p>VMs on a private 10.0.0.x network can reach <em>out</em> (via NAT) but aren&#39;t reachable <em>in</em>. To SSH into them cleanly, you need a <strong>Neutron router</strong> bridging the tenant network to an <strong>external network</strong>, plus <strong>floating IPs</strong>.</p><pre># External (provider) network<br>openstack network create --external --provider-network-type flat \<br>  --provider-physical-network physnet1 external-net<br>openstack subnet create external-subnet --network external-net \<br>  --subnet-range 192.168.0.0/24 --gateway 192.168.0.1 \<br>  --allocation-pool start=192.168.0.224,end=192.168.0.254 --no-dhcp<br> <br># Router wiring both sides<br>openstack router create main-router<br>openstack router set main-router --external-gateway external-net<br>openstack router add subnet main-router tenant-subnet<br> <br># Floating IP → VM<br>openstack floating ip create external-net<br>openstack server add floating ip my-first-vm &lt;FLOATING-IP&gt;</pre><h3>The Single-NIC Limitation (and the real fix)</h3><p>With OVN, there’s <strong>no </strong><strong>qrouter namespace</strong> to hop through, and the dummy1 interface has no physical uplink — so floating IPs weren&#39;t reachable from the LAN. The proper fix was using the <strong>second physical NIC</strong> as the external interface:</p><pre># globals.yml<br>neutronexternalinterface: &quot;enp3s0&quot;   # real NIC, cabled, no IP</pre><pre>kolla-ansible reconfigure -i ~/all-in-one --tags neutron</pre><p><strong>Gotcha:</strong> the reconfigure updated the config but didn’t actually swap the physical port on the OVS bridge — it still had dummy1. I had to move it manually (OVS runs inside a container):</p><pre>sudo docker exec openvswitch_vswitchd ovs-vsctl list-ports br-ex   # showed dummy1<br>sudo docker exec openvswitch_vswitchd ovs-vsctl del-port br-ex dummy1<br>sudo docker exec openvswitch_vswitchd ovs-vsctl add-port br-ex enp3s0</pre><p>After that, the floating IP pinged from the whole LAN. <strong>Lesson:</strong> when you change neutron<em>external</em>interface, verify the physical port actually moved on br-ex — don&#39;t assume reconfigure did it.</p><h3>Making the Dashboard Public via Cloudflare Tunnel</h3><p>Two halves that must match: the tunnel <strong>and</strong> telling OpenStack its external hostname.</p><p><strong>Tunnel:</strong></p><pre>wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64.deb<br>sudo dpkg -i cloudflared-linux-amd64.deb<br>cloudflared tunnel login<br>cloudflared tunnel create openstack<br>cloudflared tunnel route dns openstack dashboard.example.com</pre><pre># ~/.cloudflared/config.yml<br>tunnel: openstack<br>credentials-file: /home/user/.cloudflared/&lt;TUNNEL-ID&gt;.json<br>ingress:<br>  - hostname: dashboard.example.com<br>    service: http://192.168.0.250:80<br>  - service: http_status:404</pre><p><strong>Tell OpenStack the FQDN</strong> (in globals.yml) and reconfigure:</p><pre>kollaexternalfqdn: &quot;dashboard.example.com&quot;</pre><pre>kolla-ansible reconfigure -i ~/all-in-one --tags horizon,haproxy</pre><p><strong>The “Cookies may be turned off” fix:</strong> Horizon behind an HTTPS-terminating proxy needs to trust the forwarded protocol. Create /etc/kolla/config/horizon/_9999-custom-settings.py:</p><pre>SECUREPROXY_SSL_HEADER = (&quot;HTTP_X_FORWARDEDPROTO&quot;, &quot;https&quot;)<br>CSRFTRUSTEDORIGINS = [&#39;https://dashboard.example.com&#39;]<br>CSRFCOOKIESECURE = True<br>SESSIONCOOKIESECURE = True</pre><p>Then kolla-ansible reconfigure -i ~/all-in-one --tags horizon.</p><p><strong>Make the tunnel permanent</strong> (systemd, survives reboots):</p><pre>sudo mkdir -p /etc/cloudflared<br>sudo cp ~/.cloudflared/config.yml ~/.cloudflared/*.json /etc/cloudflared/<br># point credentials-file in the copied config at /etc/cloudflared/&lt;UUID&gt;.json<br>sudo tee /etc/systemd/system/cloudflared.service &gt;/dev/null &lt;&lt;&#39;EOF&#39;<br>[Unit]<br>Description=Cloudflare Tunnel<br>After=network.target<br>[Service]<br>ExecStart=/usr/bin/cloudflared --config /etc/cloudflared/config.yml tunnel run<br>Restart=on-failure<br>User=root<br>[Install]<br>WantedBy=multi-user.target<br>EOF<br>sudo systemctl enable --now cloudflared</pre><p>Dashboard now public at https://dashboard.example.com, over HTTPS, through CGNAT, surviving reboots.</p><h3>The Bug That Cost Me the Most: Cloud Image vs Installer ISO</h3><p>I spent a long time convinced SSH key injection was broken. VMs were ACTIVE, the network worked, metadata was healthy, keys were correct — but SSH always fell back to asking for a password.</p><p>The culprit, revealed only when I opened the <strong>noVNC console</strong>: the VM was sitting at the <strong>Ubuntu installer’s language-selection screen.</strong> I had registered an <strong>installer ISO</strong> in Glance, not a <strong>cloud image.</strong> An installer never runs cloud-init, never injects your key — it’s just waiting for someone to install an OS.</p><p>The fix:</p><pre># The REAL cloud image — note &quot;cloudimg&quot; in the name, ~600MB .img<br>wget https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img<br>openstack image create &quot;ubuntu-24.04&quot; --file ubuntu-24.04-server-cloudimg-amd64.img \<br>  --disk-format qcow2 --container-format bare --public</pre><p><strong>The keeper lesson:</strong></p><ul><li><strong>Cloud images</strong> = cloudimg, ~500–700 MB .img (qcow2). Use these for OpenStack.</li><li><strong>Installer ISOs</strong> = live-server, ~2–3 GB .iso. These are for installing on bare metal. <strong>Never</strong> for cloud VMs.</li></ul><p>After swapping to the real cloud image, cloud-init ran, injected the key, and:</p><pre>ssh-keygen -R &lt;floating-ip&gt;   # clear stale host key from a previous VM on that IP<br>ssh ubuntu@&lt;floating-ip&gt;      # straight into Ubuntu 24.04, passwordless</pre><p>(That REMOTE HOST IDENTIFICATION HAS CHANGED warning is expected when you recreate a VM on a reused IP — ssh-keygen -R clears it.)</p><h3>What I Ended Up With</h3><ul><li>A bare-metal <strong>OpenStack private cloud</strong> (Kolla-Ansible, 2025.1, Ubuntu 24.04), every service containerized</li><li><strong>Horizon publicly accessible</strong> via Cloudflare Tunnel, no public IP, surviving reboots</li><li>Full Neutron networking: tenant network, external network, router, floating IPs on a real NIC</li><li><strong>Direct, key-authenticated SSH from my laptop</strong> into a real Ubuntu VM</li></ul><h3>Lessons Worth Tattooing</h3><ol><li><strong>Cloud images, not installer ISOs.</strong> cloudimg .img, never live-server .iso. This one cost the most.</li><li><strong>Match versions to the live support matrix</strong> — newest ≠ supported. Check today, not from memory or an old blog.</li><li><strong>Verify OVS bridge changes actually applied</strong> — ovs-vsctl list-ports br-ex after changing the external interface.</li><li><strong>Prechecks are your friend</strong> — they fail specifically; read the error, fix, re-run.</li><li><strong>Have out-of-band access</strong> (JetKVM/IPMI). Networking changes <em>will</em> eventually drop your SSH, and the console saves you.</li><li><strong>CGNAT isn’t a blocker</strong> — outbound tunnels (Cloudflare/Tailscale) sidestep it entirely.</li><li><strong>Get it working simply first, then add the clean architecture.</strong> Single-NIC NAT → then the router and second NIC.</li></ol><h3>Where to Go Next</h3><ul><li>A <strong>bastion + ingress</strong> architecture for secure multi-VM access</li><li>Public web services on VMs via more Cloudflare tunnels (subdomain-per-service)</li><li><strong>Terraform</strong> with the OpenStack provider to codify the whole tenant as reproducible infrastructure</li><li>Re-enable <strong>Cinder</strong> for persistent block storage</li></ul><p>If you’ve got a spare mini PC and a weekend (okay — maybe two), this is one of the most educational projects you can do. You don’t just <em>use</em> a cloud; you understand every layer because you had to fight through each one yourself.</p><p><em>Got questions or hit a different wall? Drop a comment below.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0aad6a80a6e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Outh2 Sign In with Rails and React]]></title>
            <link>https://medium.com/@sumitgautam_11332/google-outh2-sign-in-with-rails-and-react-975a34c25f13?source=rss-c8ebfdda7a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/975a34c25f13</guid>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[ruby-on-rails]]></category>
            <dc:creator><![CDATA[Sumit Gautam]]></dc:creator>
            <pubDate>Tue, 02 Jan 2018 10:29:21 GMT</pubDate>
            <atom:updated>2018-01-02T10:41:00.067Z</atom:updated>
            <content:encoded><![CDATA[<p>For this blog post we will be using ruby version 2.4.0 and rails version 5.1.4 as backend and React/Redux as frontend. Adding Google Sign in functionality in your application can be done in two popular ways.</p><ul><li>Adding google sign in functionality in the front-end with google API client gapi.</li><li>Adding google sign in functionality logic in the back-end server.</li></ul><p>If your application has separate back-end with APIs feeding data to the front-end React application, I suggest you to follow the step 2. If you want yo enhance your application security, then you implement both.</p><p>Before we can work on the actual code for authentication, we need to do some setup on the Google Developer Console.</p><ul><li>First, sign into the <a href="https://console.developers.google.com/">Google APIs console</a>. Then click on the ‘Select a project’ drop down in the upper right and click Create Project.</li><li>The create project modal will appear. Enter a project name and agree to the terms of service, then click ‘Create’.</li><li>Next, do a search for contacts then click on the Contacts API entry that pops up.</li><li>Click the blue enable button, then click the back button right next to it once it enables.</li><li>Now do another search for google+ and click the Google+ API entry that appears.</li><li>Click the enable button.</li><li>Now click the Credentials link on the left side of the screen.</li><li>Next, click Oauth Consent Screen, fill in the details, and click save.</li><li>Next click the blue button that says Create Credentials and choose OAuth client ID.</li><li>Choose Web application, enter <a href="http://localhost:3000/auth/google_oauth2/callback">http://localhost:3000/auth/google_oauth2/callback</a>, then hit create.</li><li>A box will pop up containing your credentials, copy them to a text file, you will need them later.</li></ul><p>Now we are ready to dive into adding the google sign in logic to the back-end.</p><h3>Adding google sign in logic to your back-end application</h3><p>Now that we’ve set up things with Google, we need to add the code necessary for actual google Oauth2 integration.</p><p>This blog post assumes that you are using <a href="https://github.com/lynndylanhurley/devise_token_auth">devise_token_auth gem</a> or handling User registration, sign in, sign out. This gem pretty much adds all the field to the database during migration such as provider and uid, which shall be used later on. Once you are done with devise_token_auth gem. Now is the time to move ahead for adding google sign in logic to the rails back-end.</p><p>The best way to authenticate with Google is to use the omniauth-google_oauth2 gem. This gem allows you to quickly and easily add Google authentication, and it plays nice with all of the other omniauth gems. Add the gem to your gemfile.</p><p>Gemfile.rb</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/86a61136ee784e96326081adfe77f315/href">https://medium.com/media/86a61136ee784e96326081adfe77f315/href</a></iframe><p>Now run bundle</p><p>Next, we need to create an initializer. Create an initializer in the initializers folder called omniauth.rb or if you are using Devise gem to handle users then add the code listed below into you devise.rb file inside of initializer. If you are editing an existing project that already uses omniauth you can just add the code below to your existing omniauth.rb file. Make sure to replace Google client id with your Google client id, and Google client secret with your Google client secret.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/91db3935a91324eb1fb618d0143eb5ea/href">https://medium.com/media/91db3935a91324eb1fb618d0143eb5ea/href</a></iframe><p>On some systems, Rails is unable to find any cert files for SSL certificates. This presents a problem since the actual authentication is done via SSL. To resolve this, you will need to <a href="https://gist.github.com/SumitGA/curl.haxx.se/ca/cacert.pem">download this cert file </a>and place it in the root directory of your Rails application making sure the file does not have a .txt extensionn on the end.</p><p>Since you are using devise_token_auth gem to handle user’s session, it also adds omniauth routes for you, but for this post we are doing from the scratch. So go ahead and skip the omniauth routes in your routes file as shown below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/322552102acb07b7f2727b62c6dcac55/href">https://medium.com/media/322552102acb07b7f2727b62c6dcac55/href</a></iframe><p>And also add a new routes for handling google sign in authentication by yourself</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0e1c6a0b72b672c5a819b305f779371/href">https://medium.com/media/c0e1c6a0b72b672c5a819b305f779371/href</a></iframe><p>Now is the perfect time to create an authorization controller as mentioned in the routes file. Make sure the controller name is same as in the routes.rb</p><p>Add the following code block to your authorization controller file you just created.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b0b8e8800fc26bafe8b795ba9ef9385e/href">https://medium.com/media/b0b8e8800fc26bafe8b795ba9ef9385e/href</a></iframe><p>Next thing to do is to add some code to your User model. All you need to do is create a method create_user_for_google in your user model. Add the following code block to your User.rb file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52b77b65ca5fde86f8297bddf0d64e84/href">https://medium.com/media/52b77b65ca5fde86f8297bddf0d64e84/href</a></iframe><p>Rendering the appropriate response for signed up user from our backend API</p><ul><li>It is never a good approach to directly render a user object from our backend api, Instead response a success status and also we need to attach a headers with access-tokens, clients, uid, expiry inorder to sign in a user to our API. You want to ingnore all these tokens then you can configure your devise_token_auth.rb file to ignore then. But I recommend that you do include those tokens. This will provide your api with extra layer of security.</li><li>The code block below adds an headers and satus code to the api response.</li></ul><p>controller file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/84f842b834d967ff29a726646ccded42/href">https://medium.com/media/84f842b834d967ff29a726646ccded42/href</a></iframe><h3>Adding Google Sign in React Component in the frontend</h3><p>After your have already completed the backend part, now is the time to add sign in button(React Component) to your frontend.</p><p>We will be using <a href="https://www.npmjs.com/package/react-google-oauth">react-google-oauth</a> react component to add sign in with google button to our react application.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/105fd2cf1f47c99af25e495fe9e55b32/href">https://medium.com/media/105fd2cf1f47c99af25e495fe9e55b32/href</a></iframe><p>Follow the link above to get the npm package of the react-google-oauth component.</p><p>Add the component to your login form, page whatever as so.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/836be950e0157a2f9efa74b4a434a96e/href">https://medium.com/media/836be950e0157a2f9efa74b4a434a96e/href</a></iframe><p>The callback method that the component will execute on success-full authentication is responseGoogle.</p><p>Now create a method responseGoogle as so.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f09c0265e8dfa26946dc5afaf6828df5/href">https://medium.com/media/f09c0265e8dfa26946dc5afaf6828df5/href</a></iframe><p>Your front-end application should check for the Cookie data for signed in user which you have already set. The front-end application will now redirect to the home page.</p><blockquote><em>Congratulation!! You are now successfully logged in with google.</em></blockquote><h3>Google Sign in with Javascript client gapi</h3><p>Install gapi client with npm package as follows</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd6fb20d3c201ed095b2cc5f77a38a6a/href">https://medium.com/media/fd6fb20d3c201ed095b2cc5f77a38a6a/href</a></iframe><p>Now add the gapi client as so.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a8ca2ffd69b2c7c3d3845b8eccf00670/href">https://medium.com/media/a8ca2ffd69b2c7c3d3845b8eccf00670/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=975a34c25f13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hugo Static Site Generator]]></title>
            <link>https://medium.com/@sumitgautam_11332/hugo-static-site-generator-901e70461ac?source=rss-c8ebfdda7a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/901e70461ac</guid>
            <category><![CDATA[go]]></category>
            <category><![CDATA[static-site-generator]]></category>
            <category><![CDATA[golang]]></category>
            <dc:creator><![CDATA[Sumit Gautam]]></dc:creator>
            <pubDate>Tue, 02 Jan 2018 09:26:45 GMT</pubDate>
            <atom:updated>2018-01-02T09:26:45.041Z</atom:updated>
            <content:encoded><![CDATA[<p>Hugo is a fast and modern static site generator written in Go, and designed to make website creation fun again. Hugo is a general-purpose website framework. Technically speaking, Hugo is a static site generator. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website’s end users and an ideal writing experience for website authors.</p><blockquote><em>Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including Netlify, Heroku, GoDaddy, DreamHost, GitHub Pages, Surge, Aerobatic, Firebase, Google Cloud Storage, Amazon S3, Rackspace, Azure, and CloudFront and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP.</em></blockquote><h3>Getting Started With Hugo Framework</h3><p>In order to start creating a static site with Hugo framework you need to consider the following steps.</p><h3>Step 1. Install Hugo</h3><p>You need to install the Go language first before installing Hugo framework since Hugo framework is built using Go language.</p><blockquote><em>You can Download and install Go </em><a href="https://golang.org/doc/install"><em>Here</em></a><em> if you have not installed it yet.</em></blockquote><p>Now your system is ready for installing Hugo framework Download Hugo Framework <a href="https://gohugo.io/getting-started/">Here</a></p><h3>Step 2. Create a new Hugo Site</h3><pre>hugo new site Sites</pre><p>The above will create a new Hugo site in a folder named Sites.</p><h3>Step 3. Add a Theme</h3><p>see <a href="https://themes.gohugo.io/">themes.gohugo.io</a> for more themes and select the one you like. This blog post uses the beautiful Ananke theme.</p><pre>cd Sites git init git submodule add https://github.com/budparr/gohugo-theme-ananke.git themes/ananke</pre><p>Edit your config.toml configuration file and add the Ananke theme</p><pre>echo &#39;theme = &quot;ananke&quot;&#39; &gt;&gt; config.toml</pre><h3>Step 4. Adding contents</h3><pre>hugo new posts/my-first-post.md</pre><p>Edit the newly created content file if you want.</p><blockquote><em>Inorder to add the navigation contents such as about link, blog link, career link</em></blockquote><p>for about page</p><pre>hugo new about.md</pre><p>for contact page</p><pre>hugo new contact.md</pre><p>for adding new blogs</p><pre>hugo new blogs/new-blog-title.md</pre><h3>Step 5. Start Your server with Draft enabled</h3><pre>hugo server -D Started building sites ... Built site for language en: 1 of 1 draft rendered 0 future content 0 expired content 1 regular pages created 8 other pages created 0 non-page files copied 1 paginator pages created 0 categories created 0 tags created total in 18 ms Serving pages from memory Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) Press Ctrl+C to stop</pre><h3>Step 6. Customizing your Sites</h3><p>Since you have added already added a templates from the gohugo.io, your site already looks great, but incase if you still want to tweak you sites with custom stylings feel free to so by adding external css and js. Inorder to add external css and js to your site, grab the custom css and js file and add them to your static folder with corresponding folder CSS and JS and edit your config.toml file with the following content:</p><p>externalCSS = [&quot;your-css-file.css&quot;]</p><p>externalJS = [&quot;your-js-file.js&quot;]</p><h3>Step 8. Deploying Hugo Static to a Remote Server</h3><p>Compile the site with</p><pre>hugo</pre><p>The above command will generate a public folder inside of your hugo application. Copy the public folder and paste it into your www folder</p><p>for example</p><p>/home/user-data/www/default</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=901e70461ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>