.. _installation: ============ Installation ============ This guide provides instructions for installing one or more components of the Wattsworth stack. The choice of components and their configuration depends on your use case. If you are unsure of which components you need simply follow this guide in order starting with the :ref:`sec-install-prereqs` section below. * **Standalone System**: :ref:`sec-install-joule` and :ref:`sec-install-lumen` with :ref:`sec-install-nginx`: * **Data Acquisition Node**: :ref:`sec-install-joule` with :ref:`sec-install-nginx` * **Data Analysis Node**: :ref:`sec-install-joule` in a virtual environment * **Data Access Node**: :ref:`sec-install-lumen` with :ref:`sec-install-nginx` .. _sec-install-prereqs: Prerequistes ============ .. _sec-install-docker: Docker ------ Install the Docker using the instructions for your OS available on https://docs.docker.com/engine/install/. The script below should work on most OS distributions but is not generally recommend for production systems. .. raw:: html
version: "3.9"
services:
postgres:
image: timescale/timescaledb:2.11.2-pg15
restart: always
environment:
POSTGRES_USER: joule
POSTGRES_PASSWORD: joule
POSTGRES_DB: joule
volumes:
- /opt/timescaledb/data:/var/lib/postgresql/data # persist data
ports:
- 127.0.0.1:5432:5432
[Unit]
Description=TimescaleDB
After=docker.service
[Service]
Type=simple
WorkingDirectory=/opt/timescaledb
ExecStart=/usr/bin/docker compose up
ExecStop=/usr/bin/docker compose down
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
version: "3.9"
services:
postgres:
image: timescale/timescaledb:2.11.2-pg15
restart: always
environment:
POSTGRES_USER: joule
POSTGRES_PASSWORD: joule
POSTGRES_DB: joule
volumes:
- /opt/timescaledb/data:/var/lib/postgresql/data # persist data
joule:
image: wattsworth/joule:latest
restart: always
environment:
# generate with [openssl rand -hex 16] or similar
USER_KEY: ebf8d....b43c2
ports:
- 127.0.0.1:8181:80
[Unit]
Description=Lumen
After=docker.service
[Service]
Type=simple
WorkingDirectory=/opt/lumen
ExecStart=/usr/bin/docker compose up
ExecStop=/usr/bin/docker compose down
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
server{
listen 80;
# server_name directive is optional, but recommended
# Include one or both statements below to enable lumen and/or joule
include "/etc/nginx/lumen.conf";
include "/etc/nginx/joule.conf";
}
# Note this requires a valid SSL certificate that matches the servername
# Subdomain applications require a wildcard certificate for *.app.<domain>
server{
listen 80; # redirect http traffic to https
return 301 https://$host$request_uri;
}
server{
listen 443 ssl;
# Change server name to match your domain
# include *.app if using subdomain apps configuration
server_name example.wattsworth.net *.app.example.wattsworth.net;
# Include one or both statements below to enable lumen and/or joule
include "/etc/nginx/lumen.conf";
include "/etc/nginx/joule.conf";
# Security configuration
# Note: For subdomain apps this must include wildcard *.app.
ssl_certificate fullchain.pem;
ssl_certificate_key privkey.pem;
}