# How to Install Wiki.js on Ubuntu 24.04

> URL: https://www.atlantic.net/dedicated-server-hosting/how-to-install-wiki-js-on-ubuntu-24-04/ | Published: 2024-07-10 | Updated: 2025-05-25 | Author: Hitesh Jethva

Wiki.js is a powerful, flexible, and modern open-source wiki application designed to help you manage your documentation and knowledge base effectively. Built on Node.js, it offers a sleek user interface, extensive customization options, and seamless integration with various authentication systems and data sources.

This guide will walk you through the steps to install Wiki.js on Ubuntu 24.04.

## Step 1 – Install Node.js

First, install the necessary dependencies using the following command.

```
apt-get install -y ca-certificates curl gnupg
```

Next, download the Node.js GPG key.

```
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
```

Next, add the NodeSource repo to the APT source list.

```
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
```

Then, update the repository index and install Node.js with the following command.

```
apt update
apt-get install -y nodejs
```

Next, verify the Node.js version using the following command.

```
node -v
```

Output.

```
v22.15.1
```

## Step 2 – Install and Configure MariaDB Database

Wiki.js uses MariaDB as its database. You can install the MariaDB server with the following commands:

```bash
apt install mariadb-server -y
```

Once the MariaDB is installed, connect to the MariaDB shell using the following command.

```bash
mysql
```

Next, create a database and user for Wiki.js.

```bash
CREATE DATABASE wikijs;
GRANT ALL on wikijs.* to wikijs@localhost identified by 'password';
```

Next, flush the privileges and exit from the MariaDB shell.

```bash
FLUSH PRIVILEGES;
EXIT;
```

## Step 3 – Install Wiki.js

First, create a dedicated user for Wiki.js.

```bash
useradd -m -d /opt/wikijs -U -r -s /bin/bash wikijs
```

Log in to your wikijs user:

```bash
su - wikijs
```

Download the latest version of Wiki.js:

```bash
wget https://github.com/Requarks/wiki/releases/latest/download/wiki-js.tar.gz
```

Extract the downloaded file.

```bash
tar -xzvf wiki-js.tar.gz
```

Copy the sample configuration file.

```bash
cp -a config.sample.yml config.yml
```

Edit the sample configuration file.

```bash
nano config.yml
```

Define your database settings:

```bash
db:
  type: mariadb

  # PostgreSQL / MySQL / MariaDB / MS SQL Server only:
  host: localhost
  port: 3306
  user: wikijs
  pass: password
  db: wikijs
```

Save and close the file then exit from the Wiki.js user.

```bash
exit
```

## Step 4 – Create a Systemd Service

To ensure Wiki.js runs as a service and starts on boot, create a systemd service file:

```bash
nano /etc/systemd/system/wikijs.service
```

Add the following content to the file:

```bash
[Unit]
Description=Wiki.js
After=network.target

[Service]
Type=simple
ExecStart=/usr/bin/node server
Restart=always

User=wikijs
Environment=NODE_ENV=production
WorkingDirectory=/opt/wikijs

[Install]
WantedBy=multi-user.target
```

Reload the systemd daemon to apply the new service file:

```bash
systemctl daemon-reload
```

Enable and start the Wiki.js service:

```bash
systemctl enable --now wikijs
```

## Step 4 – Configure Nginx as a Reverse Proxy

If you want to serve Wiki.js through a domain and use Nginx as a reverse proxy, install Nginx first:

```bash
apt install nginx
```

Create a new Nginx configuration file:

```bash
nano /etc/nginx/conf.d/wiki.conf
```

Add the following configuration:

```bash
server {
  listen 80;
  server_name  wikijs.example.com;
  root   /opt/wikijs;

    location / {
    proxy_pass          http://127.0.0.1:3000;
    proxy_http_version  1.1;
    proxy_set_header    Upgrade $http_upgrade;
    proxy_set_header    Connection "upgrade";
    proxy_set_header    Host $host;
    proxy_set_header    X-Real-IP $remote_addr;
    proxy_set_header    X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header    X-Forwarded-Proto $scheme;
  }
}
```

Edit the Nginx main configuration file:

```bash
nano /etc/nginx/nginx.conf
```

Add the following lines after the line http {:

```bash
server_names_hash_bucket_size 64;
```

Save the file then restart the Nginx service to apply the changes.

```bash
systemctl restart nginx
```

## Step 5 – Access Wiki.js

Open a web browser and navigate to **http://wikijs.example.com.** You will see the following page:

![](https://www.atlantic.net/wp-content/uploads/2024/05/p1-1.png)

Set your email, password, and site URL, and click on **INSTALL**. You will be redirected to the Wiki.js login page:

![](https://www.atlantic.net/wp-content/uploads/2024/05/p2.png)

Provide your email and password and click on **Log** **in**. You will see the following page:

![](https://www.atlantic.net/wp-content/uploads/2024/05/p3-1.png)

Click on **ADMINISTRATION.** You will see the Wiki.js dashboard.

![](https://www.atlantic.net/wp-content/uploads/2024/05/p4.png)

## Conclusion

Installing Wiki.js on Ubuntu 24.04 is a comprehensive process that involves setting up the necessary software stack, configuring your environment, and deploying the application. By carefully following each step, from updating your system and installing Node.js, MariaDB, and other dependencies, to configuring Wiki.js and ensuring it runs as a service, you can achieve a smooth and efficient installation. With Wiki.js up and running, you now have a modern and feature-rich platform for managing your documentation and knowledge base. This setup not only enhances collaboration and information sharing but also provides a scalable solution that can grow with your needs. Let’s deploy Wiki.js on [dedicated server hosting](https://www.atlantic.net/dedicated-server-hosting/) from Atlantic.Net!
