Skip to content
BareStack
Documentation

Self-Hosting
Setup Guide

Everything you need to run BareStackOS on your own server. One command, one binary, no Docker and no separate database to manage.

Quick Start

BareStackOS installs itself. One command downloads PocketBase (the single binary that is the database, API and admin UI), applies the schema, builds the app and writes a launcher for you.

bash
git clone https://github.com/anirudhprashant/BareStackOS.git
cd BareStackOS
./install.sh
./start.sh
Then open http://localhost:8080 and create your account. The PocketBase admin console is at http://localhost:8092/_/ — the installer prints its generated password once.

There is no default login. The installer creates an admin with a random 24-character password and prints it a single time. Your data lives in ./pb_data on this machine and never leaves it.

Prefer to run it as a one-liner? curl -sSL https://raw.githubusercontent.com/anirudhprashant/BareStackOS/main/install.sh | bash works, but you should read a script before piping it into bash. You can pin the PocketBase checksum with BARESTACK_PB_SHA256; the installer then aborts if the download does not match.

Installation

Two paths: the installer (recommended) or a manual setup you control step by step. There is no Docker requirement and no external database.

1

What you need

  • Linux or macOS (Windows works through WSL)
  • Node.js 20.19+ or 22.12+ (Vite 7 requires it) and npm
  • curl and unzip
  • 1 GB RAM and 2 GB disk is plenty for a small team
  • A domain pointed at the server (only for production)
2

What the installer does

  1. Checks for Node, npm, curl and unzip.
  2. Downloads PocketBase 0.36.2 (pinned) into ./bin/pocketbase, verifying the release checksum.
  3. Installs npm dependencies.
  4. Applies the version-controlled collections and access rules from pb_migrations/.
  5. Creates the PocketBase admin with a random password.
  6. Builds the frontend against your local PocketBase and writes start.sh.
3

Manual install

bash
# 1. Dependencies
npm install

# 2. PocketBase 0.36.2, into ./bin so it never shadows the npm module
mkdir -p bin
curl -fL "https://github.com/pocketbase/pocketbase/releases/download/v0.36.2/pocketbase_0.36.2_linux_amd64.zip" -o pb.zip
unzip -o pb.zip pocketbase -d bin
chmod +x bin/pocketbase

# 3. Schema and admin
./bin/pocketbase migrate up --dir ./pb_data --migrationsDir ./pb_migrations
./bin/pocketbase superuser upsert admin@barestack.local "$(openssl rand -base64 18)" --dir ./pb_data

# 4. Build and run
VITE_POCKETBASE_URL=http://127.0.0.1:8092 npm run build
./bin/pocketbase serve --dir ./pb_data --migrationsDir ./pb_migrations --hooksDir ./pb_hooks --http="127.0.0.1:8092"
PORT=8080 node serve.cjs

Swap linux_amd64 for linux_arm64, darwin_amd64 or darwin_arm64 as needed.

4

Start it

bash
./start.sh

#   App:    http://localhost:8080
#   Admin:  http://localhost:8092/_/

start.sh runs PocketBase and the static server together and stops both on Ctrl-C.

5

Cloud mode

To use the hosted backend at api.barestack.org instead of a local one, run ./install.sh --cloud. It builds the same app against the cloud API and skips the local PocketBase setup.

Configuration

There is no .env to fill in for a normal install. The backend URL is baked in at build time; everything else lives in the PocketBase admin console.

VariableWhenWhat
VITE_POCKETBASE_URLbuildBackend the frontend talks to. Default http://127.0.0.1:8092.
PORTrunPort for serve.cjs. Default 8080.
BARESTACK_ADMIN_EMAILinstallAdmin address. Default admin@barestack.local.
BARESTACK_REQUIRE_EMAIL_VERIFICATIONrunSet true to always require verification, even without SMTP.
VITE_DEMO_EMAIL / VITE_DEMO_PASSWORDbuildAuto-login for a public demo. Only ever a disposable account.

Email

With no SMTP configured, new sign-ups are verified automatically — otherwise nobody could get in on a fresh install. To send real mail, open the PocketBase admin at /_/ → Settings → Mail settings and add your SMTP host, user and password. Verification emails then behave normally.

Backups

Everything is in ./pb_data. Copy that folder for a full backup, or use the app's own Settings → Your data to export JSON or CSV. A JSON backup restores into any other BareStackOS instance, self-hosted or cloud.

Going Live

For anything beyond local testing, put a TLS-terminating proxy in front of both processes and stop exposing PocketBase over plain HTTP.

1

Bind PocketBase to localhost

bash
# behind a proxy, never 0.0.0.0
./bin/pocketbase serve --dir ./pb_data \
  --migrationsDir ./pb_migrations --hooksDir ./pb_hooks \
  --http="127.0.0.1:8092" \
  --origins="https://crm.example.com" \
  --publicUrl="https://api.example.com"
2

Proxy both hostnames

Two names, one machine: the app on your CRM domain and the API on its own. Caddy example — it gets certificates for you.

caddy
crm.example.com {
    reverse_proxy 127.0.0.1:8080
}

api.example.com {
    reverse_proxy 127.0.0.1:8092
}

With Nginx, proxy both names to the same ports and keep proxy_set_header Host $host;plus the WebSocket upgrade headers, or PocketBase's realtime sync will not connect.

3

Keep it running

ini
# /etc/systemd/system/barestack.service
[Unit]
Description=BareStackOS
After=network.target

[Service]
WorkingDirectory=/srv/BareStackOS
ExecStart=/srv/BareStackOS/start.sh
Restart=always
User=barestack

[Install]
WantedBy=multi-user.target
bash
sudo systemctl daemon-reload
sudo systemctl enable --now barestack
# logs
journalctl -u barestack -f
4

Firewall

bash
sudo ufw default deny incoming
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enable

8080 and 8092 should not be open to the internet — only 80 and 443.

5

Upgrading

bash
git pull
npm ci
VITE_POCKETBASE_URL=https://api.example.com npm run build
sudo systemctl restart barestack

Migrations are additive and idempotent; they apply on start. If a release changes configuration, the changelog calls it out under Breaking.

Tech Stack

Deliberately small. A React app, a static server, and PocketBase — which is the database, the API, the auth layer and the admin UI in one binary.

React 18
TypeScript, strict mode
Vite 7
Build tool and dev server
Tailwind CSS 4
Styling, two themes
PocketBase 0.36.2
SQLite, REST, realtime, auth, admin UI
serve.cjs
Dependency-free static server with security headers
jsPDF + AutoTable
Invoice PDFs, generated in the browser
React Router 6
Client-side routing
PM2 / systemd
Process supervision in production

No Postgres, no Prisma, no NextAuth, no Redis, no Docker. If a guide elsewhere says otherwise, it is out of date — this page describes the software that is actually in the repository.

Troubleshooting

Common issues and how to resolve them. If your problem is not listed here, open an issue on GitHub.

1. Build fails with “Failed to parse source for import analysis”
On older installers the PocketBase binary was downloaded to ./pocketbase, and Rollup resolved the bare module id “pocketbase” to the binary instead of the npm SDK.
bash
# Move the binary out of the repo root, then rebuild
mkdir -p bin && mv pocketbase bin/pocketbase
npm run build

# Fresh installs already put it in ./bin
2. Port 8080 or 8092 already in use
Something else is bound to the port — often a previous start.sh that did not exit.
bash
sudo lsof -i :8080
sudo lsof -i :8092
kill <pid>

# or run on other ports
PORT=8081 ./start.sh
# and for PocketBase: --http="127.0.0.1:8093"
3. I lost the admin password
PocketBase can reset its own superuser from the command line; no data is touched.
bash
./bin/pocketbase superuser upsert admin@barestack.local "new-password" --dir ./pb_data
4. Sign-up says “verify your email” but no email arrives
There is no SMTP configured, so the app auto-verifies — unless BARESTACK_REQUIRE_EMAIL_VERIFICATION is set, or a stale unverified session is cached.
bash
# configure mail in the admin UI
open http://localhost:8092/_/   # Settings → Mail settings

# or force auto-verification by removing the override
unset BARESTACK_REQUIRE_EMAIL_VERIFICATION
5. Blank page or 404 when refreshing a deep link
vite preview does not do SPA fallback. serve.cjs does; if you see this, you are serving dist with the wrong server.
bash
PORT=8080 node serve.cjs
# then open http://localhost:8080/projects
6. Where is my data?
Everything lives in one folder next to the binary. Back that folder up.
bash
ls -la ./pb_data
# JSON backup + restore is also in the app: Settings → Your data
Still stuck after reading the docs?

A 20-minute call can get you unblocked in minutes. No sales pitch, just practical help.

More answers in the FAQ, or compare BareStack against other tools and hosting stacks.