Commit ec5099

2025-08-21 09:41:59 Kevin Jung Park: Revised
linux/docker containers/wiki & documentation/documize.md ..
@@ 1,48 1,55 @@
# Documize
<br/>
- # Introduction
+ # Complete Installation Guide: Documize Community on Ubuntu (with PostgreSQL)
- This guide explains how to install **Documize Community** on a fresh Ubuntu Server (20.04/22.04/24.04), set up PostgreSQL, and configure everything so Documize is ready to use.
+ 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.
---
- ## 1. Update the system
- Always start with the latest updates:
- ```bash
- sudo apt update && sudo apt upgrade -y
- ```
- <br/>
+ ## 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}
- ## 2. Install required dependencies
- Always start with the latest updates:
+ ---
+
+ ## 1) Update the system & install helper tools
```bash
- sudo apt install -y wget curl ca-certificates tar
+ sudo apt update && sudo apt upgrade -y
+ sudo apt install -y curl wget jq ca-certificates tar
```
<br/>
- ## 3. Install PostgreSQL
- Run this command to install PostgreSQL:
+ ## 2) Install PostgreSQL and enable it
```bash
sudo apt install -y postgresql postgresql-contrib
+ sudo systemctl enable --now postgresql
+ sudo systemctl status postgresql --no-pager
```
+ <br/>
- Enable and start PostgreSQL:
-
+ ## 3) Create the Documize database and user (UTF-8)
```bash
- sudo systemctl enable --now postgresql
+ 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;
+ SQL
```
- Check status:
+ Verify PostgreSQL is reachable:
```bash
- sudo systemctl status postgresql
+ pg_isready -d "host=localhost port=5432 dbname=documize user=docuser"
```
+ pg_isready checks connectivity. It should report “accepting connections”.
<br/>
- ## 4. Create PostgreSQL database and user for Documize
- Switch to the PostgreSQL admin account:
+ ## 4) Create a dedicated user and folders for Documize
```bash
- sudo -u postgres psql
+ sudo useradd -r -s /usr/sbin/nologin -d /opt/documize documize || true
+ sudo mkdir -p /opt/documize /var/lib/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):
@@ 54,105 61,96 @@
```
<br/>
- ## 5. (Optional) Allow remote connections
- If Documize runs on a different host than PostgreSQL, configure it
- >| ## Instructions
- >|
- >| Edit PostgreSQL config:
- >| ```bash
- >| sudo nano /etc/postgresql/*/main/postgresql.conf
- >| ```
- >|
- >| Set:
- >| ```bash
- >| listen_addresses = '*'
- >| ```
- >|
- >| Edit host-based authentication:
- >| ```bash
- >| sudo nano /etc/postgresql/*/main/pg_hba.conf
- >| ```
- >|
- >| Add (adjust subnet if needed):
- >| ```bash
- >| host documize docuser 0.0.0.0/0 md5
- >| ```
- >|
- >| Restart PostgreSQL:
- >| ```bash
- >| sudo systemctl restart postgresql
- >| ```
-
- ## 6. Download Documize
- Check [the Documize Community releases](https://https://github.com/documize/community/releases) for the latest version. Example:
-
+ ## 5. Download the latest Documize Community binary (Linux amd64)
+ Pull the latest Linux amd64 asset from GitHub
```bash
- wget https://github.com/documize/community/releases/download/v5.0.0/documize-community-linux-amd64.tar.gz
- tar -zxvf documize-community-linux-amd64.tar.gz
- cd documize-community-linux-amd64
- ```
- <br/>
+ DL_URL="$(curl -s https://api.github.com/repos/documize/community/releases/latest \
+ | jq -r '.assets[] | select(.name | test("linux-amd64$")) | .browser_download_url')"
- ## 7. Configure Documize
- Documize uses the DATABASE_URL environment variable.
- Set it like this:
- ```bash
- export DATABASE_URL=postgres://docuser:StrongPasswordHere@localhost:5432/documize?sslmode=disable&client_encoding=UTF8
+ echo "Latest binary: $DL_URL"
+ sudo curl -L "$DL_URL" -o /opt/documize/documize
```
- To keep this permanent, add it to your shell profile:
+ Make it executable and owned by our system user:
```bash
- echo 'export DATABASE_URL=postgres://docuser:StrongPasswordHere@localhost:5432/documize?sslmode=disable&client_encoding=UTF8' | sudo tee -a /etc/environment
+ sudo chmod 0755 /opt/documize/documize
+ sudo chown documize:documize /opt/documize/documize
```
+ <br/>
- ## 8. Run Documize
- Start Documize manually:
+ ## 6) Create a Documize configuration file (TOML)
+ Documize supports a simple config file for port and DB connection. Example for PostgreSQL:
```bash
- ./documize --database-url "$DATABASE_URL"
+ 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
```
-
- By default, it runs on port 8080.
- Open in browser:
- `http://SERVER-IP:8080`
-
- Follow the setup wizard to create your admin account.
<br/>
- ## 9. (Optional) Run Documize as a systemd service
- To keep Documize running in the background and auto-start on boot.
- Create a service file:
+ ## 7) First manual run (smoke test)
```bash
- sudo nano /etc/systemd/system/documize.service
+ sudo -u documize /opt/documize/documize --config=/etc/documize/config-postgresql.conf
```
+ 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.
+
+ <br/>
- Add:
+ ## 8) Run Documize as a systemd service
+ Create the service unit:
```bash
+ sudo tee /etc/systemd/system/documize.service >/dev/null <<'EOF'
[Unit]
Description=Documize Community
After=network.target postgresql.service
+ Wants=postgresql.service
[Service]
- Type=simple
- WorkingDirectory=/home/ubuntu/documize-community-linux-amd64
- ExecStart=/home/ubuntu/documize-community-linux-amd64/documize --database-url=postgres://docuser:StrongPasswordHere@localhost:5432/documize?sslmode=disable&client_encoding=UTF8
+ User=documize
+ Group=documize
+ WorkingDirectory=/opt/documize
+ ExecStart=/opt/documize/documize --config=/etc/documize/config-postgresql.conf
Restart=always
- User=ubuntu
+ RestartSec=5s
+ AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
- ```
+ EOF
- Reload systemd and enable:
- ```bash
- sudo systemctl daemon-reexec
+ sudo systemctl daemon-reload
sudo systemctl enable --now documize
+ sudo systemctl status documize --no-pager
```
+ <br/>
- Check status:
+ ## 9) (Optional) UFW firewall opening
```bash
- sudo systemctl status documize
+ sudo ufw allow 8080/tcp
+ sudo ufw reload
```
- <br>
+ <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
+
+ - Put Documize behind NginxLet’s Encrypt and terminate TLS there. Back up PostgreSQL regularly (pg_dump/pg_dumpall).
:::success
# Installation completed!
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