tags: hugo

Installation:

root@tealby:~# wget --quiet --no-verbose https://github.com/gohugoio/hugo/releases/download/v0.164.0/hugo_extende
d_withdeploy_0.164.0_Linux-64bit.tar.gz --output-document=/tmp/hugo_extended_withdeploy_0.164.0_Linux-64bit.tar.g
z 
root@tealby:~# ls -l /tmp/hugo_extended_withdeploy_0.164.0_Linux-64bit.tar.gz 
-rw-r--r-- 1 root root 30614688 Jul  6 17:46 /tmp/hugo_extended_withdeploy_0.164.0_Linux-64bit.tar.gz

root@tealby:~# mkdir /usr/local/hugo-0.164.0
root@tealby:~# ls -ld /usr/local/hugo-0.164.0
drwxr-xr-x 2 root root 4096 Aug  2 17:52 /usr/local/hugo-0.164.0

root@tealby:~# tar --directory=/usr/local/hugo-0.164.0 -zxvf /tmp/hugo_extended_withdeploy_0.164.0_Linux-64bit.tar.gz 
hugo
README.md
LICENSE

root@tealby:~# ls -l /usr/local/hugo-0.164.0
-rw-r--r-- 1 root root    11357 Jul  6 16:38 LICENSE
-rw-r--r-- 1 root root    13701 Jul  6 16:38 README.md
-rwxr-xr-x 1 root root 95990912 Jul  6 16:45 hugo

root@tealby:~# (cd /usr/local/bin; ln -nfs ../hugo-0.164.0/hugo .)
root@tealby:~# ls -l /usr/local/bin/hugo
lrwxrwxrwx 1 root root 20 Aug  2 17:57 /usr/local/bin/hugo -> ../hugo-0.164.0/hugo

root@tealby:~# which hugo
/usr/local/bin/hugo
root@tealby:~# hugo version
hugo v0.164.0-ce2470e7012b5ab5fc4e10ebe4027e9f8d9e00dc+extended+withdeploy linux/amd64 BuildDate=2026-07-06T16:39:30Z VendorInfo=gohugoio

Start up:

kmaau@tealby:~$ ls -ld ${HOME}/blog
drwxr-xr-x 13 kmaau kmaau 4096 Apr 17 16:54 /home/kmaau/blog
kmaau@tealby:~$ ls -l ${HOME}/blog
drwxr-xr-x  2 kmaau kmaau 4096 Apr 11 04:18 archetypes
drwxr-xr-x  2 kmaau kmaau 4096 Apr 11 04:18 assets
drwxr-xr-x  5 kmaau kmaau 4096 Jul 17 03:02 content
drwxr-xr-x  2 kmaau kmaau 4096 Apr 11 04:18 data
-rw-r--r--  1 kmaau kmaau  673 Jun 27 03:50 hugo.toml
drwxr-xr-x  2 kmaau kmaau 4096 Apr 11 04:18 i18n
drwxr-xr-x  5 kmaau kmaau 4096 Apr 11 19:31 layouts
drwxr-xr-x 10 kmaau kmaau 4096 Aug  2 18:03 public
drwxr-xr-x  3 kmaau kmaau 4096 Apr 17 03:20 resources
drwxr-xr-x  3 kmaau kmaau 4096 Apr 12 05:46 static
drwxr-xr-x  2 kmaau kmaau 4096 Apr 11 04:18 themes

kmaau@tealby:~$ cd ${HOME}/blog
kmaau@tealby:~/blog$ hugo server --bind 0.0.0.0 --baseURL http://134.122.42.159:1313
Watching for changes in /home/kmaau/blog/archetypes, /home/kmaau/blog/assets, /home/kmaau/blog/content/{aws,database,misc}, /home/kmaau/blog/data, /home/kmaau/blog/i18n, 
/home/kmaau/blog/layouts/{_default,partials,shortcodes}, /home/kmaau/blog/static/css
Watching for config changes in /home/kmaau/blog/hugo.toml
Start building sites … 
hugo v0.164.0-ce2470e7012b5ab5fc4e10ebe4027e9f8d9e00dc+extended+withdeploy linux/amd64 BuildDate=2026-07-06T16:39:30Z VendorInfo=gohugoio

                  │ EN 
──────────────────┼────
 Pages            │ 83 
 Paginator pages  │  0 
 Non-page files   │  1 
 Static files     │  1 
 Processed images │  0 
 Aliases          │  0 
 Cleaned          │  0 

Built in 1221 ms
Environment: "development"
Serving pages from disk
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://134.122.42.159:1313/ (bind address 0.0.0.0) 
Press Ctrl+C to stop

Change detected, rebuilding site (#1).
2026-08-02 18:05:03.119 +0000
Source changed /misc/hugo/_index.md
Web Server is available at http://134.122.42.159:1313/ (bind address 0.0.0.0)
Total in 170 ms
Change detected, rebuilding site (#2).
2026-08-02 18:06:03.617 +0000
Source changed /misc/docker/_index.md
Web Server is available at http://134.122.42.159:1313/ (bind address 0.0.0.0)
Total in 46 ms
Change detected, rebuilding site (#3).
2026-08-02 18:07:13.617 +0000
Source changed /misc/hugo/hugo_installation_in_ubuntu_26_04.md
Web Server is available at http://134.122.42.159:1313/ (bind address 0.0.0.0)
Total in 119 ms

Run hugo as systemctl daemon:

root@tealby:~# which hugo
/usr/local/bin/hugo

root@tealby:~# ls -l /etc/systemd/system/hugo.service
[[red:ls: cannot access '/etc/systemd/system/hugo.service': No such file or directory]]

root@tealby:~# vi /etc/systemd/system/hugo.service
::
::

root@tealby:~# cat /etc/systemd/system/hugo.service
[[blue:[Unit]]]
[[blue:Description=Hugo Static Site Server]]
[[blue:After=network.target]]
[[blue:]]
[[blue:[Service]]]
[[blue:Type=simple]]
[[blue:User=kmaau]]
[[blue:Group=kmaau]]
[[blue:WorkingDirectory=/home/kmaau/blog]]
[[blue:]]
[[blue:ExecStart=/usr/local/bin/hugo server \]]
[[blue:    --bind 0.0.0.0 \]]
[[blue:    --baseURL https://134.122.42.159 \]]
[[blue:    --port 1313]]
[[blue:]]
[[blue:Restart=always]]
[[blue:RestartSec=5]]
[[blue:]]
[[blue:[Install]]]
[[blue:WantedBy=multi-user.target]]

root@tealby:~# systemctl daemon-reload

root@tealby:~# systemctl status hugo.service
○ hugo.service - Hugo Static Site Server
     Loaded: loaded (/etc/systemd/system/hugo.service; disabled; preset: enabled)
     Active: inactive (dead)

root@tealby:~# systemctl enable --now hugo.service
Created symlink '/etc/systemd/system/multi-user.target.wants/hugo.service''/etc/systemd/system/hugo.service'.

root@tealby:~# systemctl status hugo.service
[[green:●]] hugo.service - Hugo Static Site Server
     Loaded: loaded (/etc/systemd/system/hugo.service; enabled; preset: enabled)
     Active: [[green:active (running)]] since Fri 2026-08-21 05:40:18 UTC; 4s ago
 Invocation: a05a5e00595d4183b79e4d22943e7924
   Main PID: 267011 (hugo)
      Tasks: 6 (limit: 453)
     Memory: 107.1M (peak: 116.3M)
        CPU: 3.060s
     CGroup: /system.slice/hugo.service
             └─267011 /usr/local/bin/hugo server --bind 0.0.0.0 --baseURL https://134.122.42.159 --port 1313
Aug 21 05:40:21 tealby hugo[267011]:  Static files     │   1
Aug 21 05:40:21 tealby hugo[267011]:  Processed images │   0
Aug 21 05:40:21 tealby hugo[267011]:  Aliases          │   0
Aug 21 05:40:21 tealby hugo[267011]:  Cleaned          │   0
Aug 21 05:40:21 tealby hugo[267011]: Built in 2927 ms
Aug 21 05:40:21 tealby hugo[267011]: Environment: "development"
Aug 21 05:40:21 tealby hugo[267011]: Serving pages from disk
Aug 21 05:40:21 tealby hugo[267011]: Running in Fast Render Mode. For full rebuilds on change: hugo server --dis>
Aug 21 05:40:21 tealby hugo[267011]: Web Server is available at https://134.122.42.159:1313/ (bind address 0.0.0>
Aug 21 05:40:21 tealby hugo[267011]: Press Ctrl+C to stop

root@tealby:~# ps aux | grep [h]ugo
kmaau 267011 17.8 18.1 1797132 84312 ? Ssl 05:40 0:03 /usr/local/bin/hugo server --bind 0.0.0.0 --baseURL https://134.122.42.159 --port 1313

root@tealby:~# lsof -P -i TCP:1313
COMMAND    PID  USER FD   TYPE  DEVICE SIZE/OFF NODE NAME
hugo    267011 kmaau 4u  IPv6 2660748      0t0  TCP *:1313 (LISTEN)