Wiki with VeilNet

Learn how to deploy Wiki.js with VeilNet for secure remote documentation access.

Prerequisites

  • Docker and Docker Compose installed
  • VeilNet registration token
  • Access to VeilNet Guardian service
  • Sufficient disk space for documentation

Overview

This guide shows you how to deploy Wiki.js, a modern, open-source wiki platform, with VeilNet for secure remote access. Wiki.js provides a beautiful interface for creating and managing documentation, knowledge bases, and wikis.

With VeilNet, you can securely access your wiki from anywhere without exposing it to the public internet.

Step 1: Create Docker Compose Configuration

Create a docker-compose.yml file with the following configuration:

services:
  veilnet-conflux:
    container_name: veilnet-conflux
    restart: unless-stopped
    env_file:
      - .env
    image: veilnet/conflux:beta
    pull_policy: always
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun
    network_mode: host

  db:
    image: postgres:15-alpine
    container_name: wiki-db
    restart: unless-stopped
    environment:
      - POSTGRES_DB=wiki
      - POSTGRES_USER=wikijs
      - POSTGRES_PASSWORD=<DB_PASSWORD>
    volumes:
      - wiki-db:/var/lib/postgresql/data
    network_mode: "container:veilnet-conflux"
    depends_on:
      - veilnet-conflux

  wiki:
    image: ghcr.io/requarks/wiki:2
    container_name: wiki
    restart: unless-stopped
    depends_on:
      - veilnet-conflux
      - db
    environment:
      - DB_TYPE=postgres
      - DB_HOST=localhost
      - DB_PORT=5432
      - DB_USER=wikijs
      - DB_PASS=<DB_PASSWORD>
      - DB_NAME=wiki
    volumes:
      - wiki:/wiki/data
    network_mode: "container:veilnet-conflux"

volumes:
  wiki:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: ./wiki
  wiki-db:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: ./wiki-db

Step 2: Create Environment File

Create a .env file in the same directory as your docker-compose.yml with the following variables:

VEILNET_REGISTRATION_TOKEN=<YOUR_REGISTRATION_TOKEN>
VEILNET_GUARDIAN=<YOUR_GUARDIAN_URL>
VEILNET_PORTAL=true
VEILNET_CONFLUX_TAG=<YOUR_CONFLUX_TAG>
VEILNET_CONFLUX_CIDR=<VEILNET_CIDR>

Replace the placeholders:

  • <YOUR_REGISTRATION_TOKEN>: Your VeilNet registration token (obtained from the VeilNet portal)
  • <YOUR_GUARDIAN_URL>: The URL of your VeilNet Guardian service (e.g., https://guardian.veilnet.app)
  • <YOUR_CONFLUX_TAG>: A tag to identify this Conflux instance (e.g., wiki-server)
  • <VEILNET_CIDR>: Any IP address (e.g., 10.128.0.5/16) in CIDR format that belongs to the realm subnet (e.g., 10.128.0.0/16)
  • <DB_PASSWORD>: Strong password for PostgreSQL database (use the same value in both places)

Step 3: Create Data Directories

Create the directories for persistent data storage:

mkdir -p wiki wiki-db

These directories will store:

  • wiki: Wiki.js application data and uploaded files
  • wiki-db: PostgreSQL database files

Step 4: Deploy the Stack

Start all services:

docker-compose up -d

This will:

  • Pull the Wiki.js, PostgreSQL, and VeilNet Conflux images
  • Start all containers
  • Create persistent volumes for data storage
  • Automatically restart containers if they stop

Step 5: Verify Deployment

Check that all containers are running:

docker-compose ps

View the VeilNet Conflux logs to verify it's connecting:

docker logs veilnet-conflux -f

You should see logs indicating successful registration and connection to the VeilNet network.

Step 6: Initial Configuration

Local Access

  1. Open http://localhost:3000 in your browser
  2. Complete the Wiki.js setup wizard:
    • Site URL: Use your VeilNet IP (e.g., http://10.128.0.5:3000)
    • Site Name: Your wiki name
    • Create your administrator account
    • Select a theme
    • Complete the setup
  3. Start creating your first pages

Remote Access via VeilNet

  1. Find your host's VeilNet IP address:
ip addr show veilnet

Or check the VeilNet portal to see your assigned IP address.

  1. Access Wiki.js from anywhere using http://<veilnet-ip>:3000 (e.g., http://10.128.0.5:3000)

Step 7: Access Your Wiki

Local Access

Once the service is running, you can access it locally:

  • Web UI: http://localhost:3000

Remote Access via VeilNet

With VeilNet configured, you can access your wiki remotely from anywhere in the world using the host's VeilNet IP address, as long as your device is also connected to the same VeilNet realm.

Access the web interface using:

  • Web UI: http://<veilnet-ip>:3000 (e.g., http://10.128.0.5:3000)

Step 8: Create Your First Pages

  1. Log in to Wiki.js (locally or via VeilNet IP)
  2. Click "Create Page" to start adding content
  3. Use the markdown editor or visual editor
  4. Organize pages using folders and navigation
  5. Invite team members to collaborate

Updating Services

To update to newer versions:

docker-compose pull
docker-compose up -d

This will pull the latest images and restart the containers with updated versions.

Stopping and Removing

To stop all services:

docker-compose down

To remove containers and volumes (this will delete all data):

docker-compose down -v

Warning: Removing volumes will delete all wiki pages, files, and database. Make sure to export your wiki content before removing volumes.

FAQ

Can I use SQLite instead of PostgreSQL?

Yes! Wiki.js supports SQLite, MySQL, MariaDB, and PostgreSQL. For SQLite, you can simplify the docker-compose.yml by removing the database service and setting DB_TYPE=sqlite in the wiki environment variables.

How do I back up my wiki?

Wiki.js has built-in backup functionality. Go to Administration → Storage → Backup to create backups. You can also back up the wiki and wiki-db directories directly.

Can I use Git for version control?

Yes! Wiki.js supports Git integration. Configure a Git repository in Administration → Storage → Git to automatically sync your wiki content to a Git repository.

How do I add team members?

  1. Add team members to the same VeilNet realm through the VeilNet portal
  2. Once they can access Wiki.js via VeilNet IP, they can create accounts or you can invite them
  3. Set their permissions in Administration → Users & Groups
  4. Since Wiki.js shares the network namespace with veilnet-conflux, it can also use the VeilNet TUN device for optimal network performance

Can I customize the appearance?

Yes! Wiki.js has extensive theming options. Go to Administration → Rendering → Theme to customize colors, fonts, and layout. You can also create custom themes.

Why use NET_ADMIN capability instead of privileged mode?

The NET_ADMIN capability provides only the necessary permissions for VeilNet to create and manage network interfaces, without granting full privileged access. This is more secure while still allowing VeilNet to function properly.