+++ title = "Selfhosting a Hugo blog with mysocket.io" author = ["George Jones"] publishDate = 2021-11-12 lastmod = 2022-02-26T08:59:49-05:00 tags = ["geek", "blogging", "org", "emacs", "HOWTO"] categories = ["blog"] draft = false +++
...that time when you realize your blog is hosted on a web site who's sole purpose is to support coding, and they plaster the motto
"Learn Git and Github without any code!"
all over their site, and you realize that its been taken over by marketing clones ... and it's time to do your geekly exit stage left and self host on a raspberry pi or something...
This is a HOWTO of the things I did to migrate my HUGO blog off github onto a self-hosted raspberry pi using mysocket.io.
The original setup is described here Publishing a blog on Github with Org and Hugo
In =${HUGO_BASE_DIR}
gmj@ed blog [master] $ hugo server -v -D
browse to http//localhost:1313 to see updates in realtime.
In ${HUGO_BASE_DIR}/config.toml
update the following:
# baseurl = "https://eludom.github.io/"
baseurl = "https://curious.galthub.com/
#homepage = "eludom.github.io"
homepage = "curious.galthub.com"
The docs/
directory will be the root of your webserver
gmj@ed blog [master] $ hugo
Building sites …
| EN
-------------------+------
Pages | 210
Paginator pages | 0
Non-page files | 0
Static files | 78
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0
Total in 2718 ms
gmj@ed blog [master] $ find . -mtime -^C
gmj@ed blog [master] $ hugo server -v -D^C
gmj@ed blog [master] $ find . -mtime -5 | head
.
./.#curious.org
./curious.org
./docs/index.html
./docs/404.html
./docs/robots.txt
./docs/about/index.html
./docs/about/index.xml
./docs/sitemap.xml
./docs/tags/poetry/index.html
...
Which server...
rsync -Cavz docs gmj@hangout:~/blog
Run a web server with the root pointed at the docs/
directory
$ cd ~/blog/docs/
$ python3 -m http.server 1313
Set up a tunnel
$ mysocketctl connect --port 1313 --name hugo test
...
...
curl http://curious.port111.com