Skip to content

Running own instance with Docker

MultiMote edited this page Oct 29, 2024 · 3 revisions

If you want to run Niimblue locally, you can use Docker as possible solution.

Running

docker run --name niimblue -p 8000:80 -d ghcr.io/multimote/niimblue:latest

Then navigate you browser to http://localhost:8000

SSL (docker compose)

If you access niimblue by localhost address, everything should work. But if you choose other address, Bluetooth and serial will not work because it needs secure connection.

If you have your own http proxy server (nginx/apache/etc) with SSL enabled, it is better to add proxy forwarding to the running Docker container.

Otherwise, there is example how to set-up SSL with self-signed certificate. niim.lan will be used as domain.

Generate key and certificate:

openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj "/CN=niim.lan" -addext "subjectAltName=DNS:niim.lan"

Create nginx custom configuration (niimblue-ssl.conf):

server {
  listen 443 ssl;

  ssl_certificate /etc/nginx/ssl/cert.pem;
  ssl_certificate_key /etc/nginx/ssl/key.pem;
  # ssl_trusted_certificate /etc/nginx/ssl/cert.pem;

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

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

# redirect http to https
server {
  listen 80;
  location / {
    return 301 https://niim.lan$request_uri;
  }
}

Create docker-compose.yml:

services:
  niimblue:
    image: niimblue
    volumes:
    - ./niimblue-ssl.conf:/etc/nginx/conf.d/default.conf
    - ./cert.pem:/etc/nginx/ssl/cert.pem
    - ./key.pem:/etc/nginx/ssl/key.pem
    ports:
    - "8080:80"
    - "8443:443"

Run everything

docker compose up -d

Navigate your browser to https://niim.lan:8443

Clone this wiki locally