Lokinet hidden service

This guide shows how to set up Lokinet as a hidden service in a similar fashion to a Tor onion hidden service.

Install Lokinet

First, install Lokinet and take note of the .loki address.

This guide assumes there is already a reverse proxy occupying 80/443. This configuration is for an additional instance of NGINX that should be portable behind whichever reverse proxy is in use, so long as it can point to this service. The working example uses nginx-proxy as the reverse proxy, and has the services running on the same docker network.

Configure Docker

Example for marcd.cc and privacyroot.org:

services:
  nginx-marcd:
    image: nginx
    container_name: marcd.cc
    restart: always
    volumes:
      - /home/marc/hugo/marcd.cc/public:/usr/share/nginx/html:ro
      - ./marcd.cc/default.conf:/etc/nginx/conf.d/default.conf
      - ./marcd.cc/nginx.conf:/etc/nginx/nginx.conf
    environment:
      - VIRTUAL_HOST=marcd.cc,fji2bedq46nsfp4kdrxl4hsfj72wbdxjumzt5rx3upra7d47cm2abaid.onion
      - LETSENCRYPT_HOST=marcd.cc

  nginx-privacyroot:
    image: nginx
    container_name: privacyroot.org
    restart: always
    volumes:
      - ./privacyroot.org/default.conf:/etc/nginx/conf.d/default.conf
      - ./privacyroot.org/nginx.conf:/etc/nginx/nginx.conf
      - /home/marc/hugo/privacyroot.org/public:/usr/share/nginx/html:ro
    environment:
      - VIRTUAL_HOST=privacyroot.org,wtiphynjrz54545ik7ph967pwp5icyk9pik1ing79wt87gbgespy.loki,6pc3zc7uihte76dbsl6hvuixvxrhyhx5y5tgr62u4qzddij
t2fnc2gad.onion
      - LETSENCRYPT_HOST=privacyroot.org

networks:
  default:
    external:
      name: nginx

Configure NGINX

In this example, the NGINX configuration file is in ./privacyroot.org/default.conf:

server {
    listen 80;
    #listen  [::]:80;
    server_name 6pc3zc7uihte76dbsl6hvuixvxrhyhx5y5tgr62u4qzddijt2fnc2gad.onion wtiphynjrz54545ik7ph967pwp5icyk9pik1ing79wt87gbgespy.loki;
    add_header Onion-Location http://6pc3zc7uihte76dbsl6hvuixvxrhyhx5y5tgr62u4qzddijt2fnc2gad.onion$request_uri;
    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
        autoindex on;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

}

At this time there's no easy way to configure multiple Lokinet hidden services with different addresses on the same host.