Independent testing Updated April 2026 387 self-hosting guides 5 VPS providers tested

guide

How to Self-Host Wiki.js on a VPS (Complete Guide)

A complete guide to self-hosting Wiki.js on a VPS: install, configure, and secure Wiki.js step by step, with recommended specs and common gotchas.

How to Self-Host Wiki.js on a VPS (Complete Guide)

Wiki.js is a powerful and flexible open-source wiki software built on Node.js. Itโ€™s suitable for both personal and collaborative use, making it a popular choice for developers and homelabbers looking to self-host a documentation or knowledge management platform. This guide will walk you through the process of self-hosting Wiki.js on a Virtual Private Server (VPS). Weโ€™ll also explore using Docker for a streamlined installation experience.

Prerequisites

To follow this guide, youโ€™ll need:

Choosing the Right VPS

When selecting a VPS for hosting Wiki.js, consider the following specifications:

ProviderPriceCPURAMStorage
Contabo VPSโ‚ฌ5.99/mo4 vCPU8 GB200 GB SSD
Hetzner Cloudโ‚ฌ4.15/mo1 vCPU2 GB20 GB SSD
DigitalOcean$6/mo1 vCPU2 GB50 GB SSD
Vultr$6/mo1 vCPU2 GB55 GB SSD
Linode$5/mo1 vCPU2 GB50 GB SSD

For optimal performance, Contabo offers the best resources for the price, making it an ideal choice for hosting Wiki.js.

Step 1: Setting Up Your VPS

  1. Launch your VPS: Choose one of the plans from above that fits your needs and launch the server.

  2. Connect to your VPS: Use SSH to connect. Replace your_user and your_ip with your credentials.

    ssh your_user@your_ip
  3. Update your system:

    sudo apt update && sudo apt upgrade -y
  4. Install Docker:

    sudo apt install docker.io -y
    sudo systemctl start docker
    sudo systemctl enable docker
  5. Install Docker Compose:

    sudo apt install docker-compose -y

Step 2: Deploying Wiki.js

  1. Create a directory for Wiki.js:

    mkdir ~/wikijs && cd ~/wikijs
  2. Create a docker-compose.yml file:

    Use a text editor to create this file:

    version: "3"
    
    services:
      wikijs:
        image: requarks/wiki:latest
        ports:
          - "3000:3000"
        environment:
          - DB_TYPE=postgres
          - DB_HOST=db
          - DB_PORT=5432
          - DB_USER=wikijs
          - DB_PASS=password
          - DB_NAME=wikijs
        depends_on:
          - db
    
      db:
        image: postgres:13
        environment:
          - POSTGRES_USER=wikijs
          - POSTGRES_PASSWORD=password
          - POSTGRES_DB=wikijs
        volumes:
          - pgdata:/var/lib/postgresql/data
    
    volumes:
      pgdata:

    Modify the database credentials as needed for your setup.

  3. Start the Wiki.js service:

    sudo docker-compose up -d
  4. Access Wiki.js: Open your browser and navigate to http://your_ip:3000. Follow the on-screen instructions to complete the setup.

Step 3: Configuring Wiki.js

Once installed, you can configure Wiki.js according to your preferences. You can connect it to an external database, set up user authentication, and customize features. For first-time users, Wiki.js provides an interface that makes these tasks straightforward.

FAQ

1. What are the benefits of self-hosting Wiki.js?

Self-hosting Wiki.js grants you full control over your data and privacy. You can customize the platform according to your needs, scale resources as required, and avoid vendor lock-in. It empowers developers and teams to maintain a consistent knowledge base without the constraints of third-party services, all while being cost-effective depending on your infrastructure choices.

2. Can I use Wiki.js with an existing PostgreSQL database?

Yes, Wiki.js supports connecting to existing PostgreSQL databases. During the setup phase, you need to specify your database credentials in the docker-compose.yml file. Ensure that the version of PostgreSQL is compatible with Wiki.js requirements. You may also want to configure additional settings for optimal performance based on your databaseโ€™s specifications.

3. What happens if my VPS goes down?

If your VPS experiences downtime, Wiki.js wonโ€™t be accessible, and any edits or updates made while offline may not be saved. Regular backups are crucial. Utilizing a backup service or configuring automated backups for your PostgreSQL database can safeguard your data. Additionally, consider using monitoring tools to alert you about your VPS status, enabling you to react promptly.

Conclusion

Self-hosting Wiki.js on a VPS is a practical approach to managing documentation and collaboration in your projects. By following this guide, youโ€™ll set up a reliable knowledge management platform efficiently. For further details, check out our full VPS comparison to choose the perfect provider for your needs. Happy hosting!