Commit 110d22

2025-08-21 10:29:31 Kevin Jung Park: Updated installation guide
linux/docker containers/wiki & documentation/documize.md ..
@@ 1,119 1,130 @@
# Documize
<br/>
- # Complete Installation Guide: Documize Community on Ubuntu (with PostgreSQL)
+ # Documize Community on Ubuntu with PostgreSQL (Clean, Proven Setup)
- This guide installs **Documize Community** on a fresh Ubuntu 20.04/22.04/24.04 server, sets up PostgreSQL, and runs Documize as a systemd service. It uses Documize’s official installation approach (single binary + config file). Latest release info is referenced from Documize’s site and GitHub.
+ This guide installs **Documize Community** on a fresh Ubuntu 20.04/22.04/24.04 server, sets up PostgreSQL correctly, and runs Documize as a **systemd** service.
+ It uses the current Documize distribution method (single Linux binary), avoids the buggy config-file path, and relies on flags/environment variables.
---
- ## 0) Basics & Assumptions
- - You are on an **amd64/Intel** Ubuntu server with `sudo`.
- - We will run Documize on **port 8080** and connect to a local PostgreSQL.
- - Documize ships as a **single executable** (no installer). :contentReference[oaicite:1]{index=1}
+ ## 0) Assumptions
+
+ - Ubuntu (amd64) with `sudo` access and Internet.
+ - Documize will listen on **port 8080** (you can later put it behind Traefik/Nginx).
+ - Database user: `docuser`, Database name: `documize`.
+ - Replace the placeholders:
+ - `YourPasswordHere` → a strong DB password you choose.
+ - `YourSaltHere` → a random 32–64 hex chars string (see Step 7).
---
- ## 1) Update the system & install helper tools
+ ## 1) Update system & install helpers
+
```bash
sudo apt update && sudo apt upgrade -y
- sudo apt install -y curl wget jq ca-certificates tar
+ sudo apt install -y curl wget jq ca-certificates postgresql postgresql-contrib
+
```
- <br/>
- ## 2) Install PostgreSQL and enable it
+ Enable PostgreSQL:
```bash
- sudo apt install -y postgresql postgresql-contrib
sudo systemctl enable --now postgresql
sudo systemctl status postgresql --no-pager
```
+
<br/>
- ## 3) Create the Documize database and user (UTF-8)
+ ## Create PostgreSQL role, database
```bash
sudo -u postgres psql <<'SQL'
- CREATE DATABASE documize TEMPLATE template0 ENCODING 'UTF8';
- CREATE USER docuser WITH ENCRYPTED PASSWORD 'ChangeMe_SuperStrong_!@#';
- GRANT ALL PRIVILEGES ON DATABASE documize TO docuser;
+ -- Create app user (set your own strong password)
+ DO $$
+ BEGIN
+ IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = 'docuser') THEN
+ CREATE USER docuser WITH ENCRYPTED PASSWORD 'YourPasswordHere';
+ END IF;
+ END
+ $$;
+
+ -- (Re)create database with UTF-8 and owned by docuser
+ DROP DATABASE IF EXISTS documize;
+ CREATE DATABASE documize
+ OWNER docuser
+ TEMPLATE template0
+ ENCODING 'UTF8';
+
+ -- Ensure the public schema is correctly owned and writable
+ ALTER SCHEMA public OWNER TO docuser;
+ GRANT ALL ON SCHEMA public TO docuser;
+ GRANT CREATE, USAGE ON SCHEMA public TO docuser;
SQL
```
- Verify PostgreSQL is reachable:
+ Quick connectivity check:
```bash
pg_isready -d "host=localhost port=5432 dbname=documize user=docuser"
```
- pg_isready checks connectivity. It should report “accepting connections”.
<br/>
- ## 4) Create a dedicated user and folders for Documize
+ ## 3) Create a system user and folders for Documize
```bash
sudo useradd -r -s /usr/sbin/nologin -d /opt/documize documize || true
- sudo mkdir -p /opt/documize /var/lib/documize
+ sudo mkdir -p /opt/documize /var/lib/documize /etc/documize
sudo chown -R documize:documize /opt/documize /var/lib/documize
```
-
- Inside the PostgreSQL shell, run the following (replace the password with a strong one):
- ```bash
- CREATE DATABASE documize;
- CREATE USER docuser WITH ENCRYPTED PASSWORD 'StrongPasswordHere';
- GRANT ALL PRIVILEGES ON DATABASE documize TO docuser;
- \q
- ```
<br/>
- ## 5. Download the latest Documize Community binary (Linux amd64)
- Pull the latest Linux amd64 asset from GitHub
+ ## 4) Download the latest Documize Community binary (Linux amd64)
+ Use GitHub “latest” (auto-picks the newest Linux binary):
```bash
DL_URL="$(curl -s https://api.github.com/repos/documize/community/releases/latest \
| jq -r '.assets[] | select(.name | test("linux-amd64$")) | .browser_download_url')"
- echo "Latest binary: $DL_URL"
+ echo "Downloading: $DL_URL"
sudo curl -L "$DL_URL" -o /opt/documize/documize
- ```
-
- Make it executable and owned by our system user:
- ```bash
sudo chmod 0755 /opt/documize/documize
sudo chown documize:documize /opt/documize/documize
```
<br/>
- ## 6) Create a Documize configuration file (TOML)
- Documize supports a simple config file for port and DB connection. Example for PostgreSQL:
+ ## 5) (Optional) Open the firewall for 8080 (UFW)
```bash
- sudo tee /etc/documize/config-postgresql.conf >/dev/null<<'EOF'
- # Documize configuration (TOML)
- port = 8080
- # for SSL, you could also set:
- # forcesslport = 8443
- # cert = "/etc/documize/tls/cert.pem"
- # key = "/etc/documize/tls/key.pem"
-
- [database]
- type = "postgresql"
- # DSN style connection; ensure UTF-8:
- connection = "host=localhost port=5432 dbname=documize user=docuser password=ChangeMe_SuperStrong_!@# sslmode=disable"
-
- # Optional storage path for uploads/exports
- [storage]
- path = "/var/lib/documize"
- EOF
+ sudo ufw allow 8080/tcp
+ sudo ufw reload
```
<br/>
- ## 7) First manual run (smoke test)
+ ## 6) One-off smoke test (no config file; flags + env)
+ First, generate a salt (or use your own):
```bash
- sudo -u documize /opt/documize/documize --config=/etc/documize/config-postgresql.conf
+ openssl rand -hex 32
```
- Open your browser to:
- `http://<server-ip>:8080`
- You should see the setup UI; create the admin account and proceed.
- Stop with Ctrl+C when you’re satisfied the app starts.
+ Then run Documize just once in the foreground:
+ ```bash
+ sudo -u documize env \
+ DOCUMIZEDBTYPE=postgresql \
+ DOCUMIZEDB='host=localhost port=5432 dbname=documize user=docuser password=YourPasswordHere sslmode=disable' \
+ DOCUMIZESALT='YourSaltHere' \
+ /opt/documize/documize -port 8080
+ ```
+ Open: http://server-ip:8080/setup
+ Confirm the page loads. Ctrl+C to stop when you’re done checking.
<br/>
- ## 8) Run Documize as a systemd service
- Create the service unit:
+ ## 7) Persist with systemd (recommended)
+ Create an env file for the service:
+ ```bash
+ sudo tee /etc/documize/env >/dev/null <<'EOF'
+ DOCUMIZEDBTYPE=postgresql
+ DOCUMIZEDB=host=localhost port=5432 dbname=documize user=docuser password=YourPasswordHere sslmode=disable
+ DOCUMIZESALT=YourSaltHere
+ EOF
+ sudo chmod 0640 /etc/documize/env
+ sudo chown root:documize /etc/documize/env
+ ```
+ Create the systemd unit:
```bash
sudo tee /etc/systemd/system/documize.service >/dev/null <<'EOF'
[Unit]
@@ 125,10 136,10 @@
User=documize
Group=documize
WorkingDirectory=/opt/documize
- ExecStart=/opt/documize/documize --config=/etc/documize/config-postgresql.conf
+ EnvironmentFile=/etc/documize/env
+ ExecStart=/opt/documize/documize -port 8080
Restart=always
RestartSec=5s
- AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
@@ 140,19 151,27 @@
```
<br/>
- ## 9) (Optional) UFW firewall opening
- ```bash
- sudo ufw allow 8080/tcp
- sudo ufw reload
- ```
- <br/>
-
- ## 10) Production notes (next steps)
- - Configure mail (for notifications) and request a free activation key under Settings → Billing (the site’s “Get Started” pane explains the free tier). documize.com
+ ## 8) Complete the setup wizard
+ Open:
+ `http://<server-ip>:8080/setup`
+ Fill in organization/admin details → Complete setup.
+ From now on you’ll use the normal login URL (the setup route is one-time).
- - Put Documize behind NginxLet’s Encrypt and terminate TLS there. Back up PostgreSQL regularly (pg_dump/pg_dumpall).
+ <br/>
:::success
# Installation completed!
Documost is now installed.
:::
+
+ <br/>
+
+ ## 9) Useful operations
+ ```bash
+ # service control
+ sudo systemctl stop documize
+ sudo systemctl start documize
+ sudo systemctl restart documize
+ sudo systemctl status documize --no-pager
+ journalctl -u documize -f # live logs
+ ```
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9