Install for real use
The Quickstart starts Sensora with built-in development secrets and demo data. This page installs an empty instance that you can keep, with your own secrets, a dashboard password and an address your devices can reach.
Requirements
- A computer that stays on, with a 64-bit operating system. The stack runs on x86-64 and on arm64, which includes a Raspberry Pi 4 or 5.
- Docker with the Compose plugin. Check it with
docker compose version. gitand an internet connection for the first build.
You do not need Bun or Node.js on the host. There are no published Docker images yet, so the images are built from source on the host. This takes a few minutes on a laptop and longer on a Raspberry Pi.
Install
Get the source.
bashgit clone https://github.com/sensoraiot/sensora.git cd sensoraCreate the settings file.
bashcp deploy/.env.example deploy/.envGenerate two secrets. Each command prints one line.
bashecho "ENCRYPTION_KEY=$(openssl rand -base64 24 | head -c 32)" echo "DB_PASSWORD=$(openssl rand -hex 16)"Open
deploy/.envin an editor. Replace theENCRYPTION_KEYandDB_PASSWORDlines with the two lines you generated. Remove the#in front ofSENSORA_DASHBOARD_PASSWORDandPUBLIC_URLand set both. The four lines then look like this, with your own values:iniDB_PASSWORD=THE_DB_PASSWORD_YOU_GENERATED ENCRYPTION_KEY=THE_ENCRYPTION_KEY_YOU_GENERATED SENSORA_DASHBOARD_PASSWORD=A_LONG_PASSPHRASE_YOU_CHOOSE PUBLIC_URL=http://192.168.1.20:8090Leave the other lines of the file as they are.
Build and start the stack.
bashdocker compose -f deploy/docker-compose.yml up -d --buildCheck that it answers.
bashcurl http://localhost:8090/healthA healthy instance answers
{"status":"ok","time":"..."}, wheretimeis the clock of the server.Open
http://<address of the host>:8090in a browser and sign in with the dashboard password.
The instance is empty. Continue with First device.
WARNING
This install serves plain HTTP and is meant for your own network. Read Security before you make it reachable from the internet.
The four values you must set
| Variable | What it is | What to know |
|---|---|---|
ENCRYPTION_KEY | The secret behind device secrets, API keys, dashboard and customer sign-ins, and stored integration passwords. | The default in the repository is public. Set your own before the first start and keep a copy in a safe place. Do not change it later: device secrets, API keys and sign-ins stop working, and stored integration secrets can no longer be read. |
DB_PASSWORD | The password of the PostgreSQL user. | Set it before the first start. PostgreSQL stores it when it creates the database, so a later change in deploy/.env alone makes the server fail to connect. |
SENSORA_DASHBOARD_PASSWORD | One shared password for the dashboard. | Without it, and without an API key, everyone who can reach the port can read and change everything. |
PUBLIC_URL | The address devices, agents and customers use to reach this instance. | Use an address that works from your devices, such as http://192.168.1.20:8090 or https://sensora.example.com. Do not use localhost. The browser flasher writes this address onto boards, so give the host a fixed IP address or a host name. |
All other variables are optional. Configuration lists every variable with its default.
To apply a change in deploy/.env, run the start command again:
docker compose -f deploy/docker-compose.yml up -dWhat runs
| Service | Role | Reachable from outside |
|---|---|---|
web | nginx. Serves the dashboard and passes API and device requests to app. | Yes, on port 8090 |
app | The Sensora server. | No |
migrate | Runs at every start, applies new database migrations, then exits. app waits for it. | No |
db | PostgreSQL 16. | No |
broker | NanoMQ, an MQTT broker for the server. | No |
A sixth service, seed, writes the demo data. It runs only when you add --profile demo to the start command, and it does nothing on an instance that already has devices.
The one published port
Only web publishes a port: 8090 on every network interface of the host, over plain HTTP. Change the number with WEB_PORT. To accept connections only from the host itself, for example behind a reverse proxy on the same machine, put an address in front of the port:
WEB_PORT=127.0.0.1:8090The MQTT broker is not published, so devices on your network cannot connect to it. Read MQTT before you change that, because the broker accepts every client without a password.
Where your data is
| What | Where |
|---|---|
| Devices, readings, rules, dashboards, customers, settings | Docker volume sensora-oss_sensora-oss-db |
| Firmware images uploaded for remote updates | Docker volume sensora-oss_sensora-oss-ota |
| Secrets and settings | The file deploy/.env |
DANGER
docker compose -f deploy/docker-compose.yml down stops the stack and keeps the volumes. Adding -v to that command deletes both volumes and all your data.
Operations explains backups and updates.
Start at boot
Docker starts the services again after a crash and after a reboot, as long as Docker itself starts at boot. On a Linux host with systemd:
sudo systemctl enable dockerA service that you stopped yourself with docker compose stop stays stopped after a reboot.
Flash boards from another computer
Browsers allow USB access only on pages opened over HTTPS or at http://localhost. When Sensora runs on a server or a Raspberry Pi, the page at http://192.168.1.20:8090 is neither, so the browser flasher does not work there. USB flashing shows the ways around this.
Next steps
- Security: what protects the instance and how to add HTTPS.
- Operations: updates, backups and logs.
- First device

