How to Install Kiwix-Serve on Ubuntu Server Latest

Kiwix is a free and open-source software for offline content delivery. It allows you to access and share educational, informational and entertainment content offline, such as Wikipedia, TED talks, and Project Gutenberg. Kiwix-Serve is the web server component that enables you to host your Kiwix content and serve it to other devices over the internet or locally, making it an ideal tool for schools, libraries, and NGOs in low-bandwidth, no-internet regions. This tutorial will guide you through the steps to install Kiwix-Serve on Ubuntu Server Latest.

Prerequisites

Installing Kiwix-Serve

Step 1: Download the Kiwix-Serve binary archive from the official website using curl:

curl -L -o kiwix-serve-linux-x64.zip https://download.kiwix.org/release/kiwix-tools/kiwix-serve/kiwix-serve-linux-x64.zip

Step 2: Extract the downloaded archive:

unzip kiwix-serve-linux-x64.zip

Step 3: Move the extracted folder to the /opt directory:

sudo mv kiwix-serve /opt/

Step 4: Create a symbolic link to the Kiwix-Serve binary for convenient access:

sudo ln -s /opt/kiwix-serve/kiwix-serve /usr/local/bin/kiwix-serve

Step 5: Create a Kiwix-Serve systemd service file:

sudo nano /etc/systemd/system/kiwix-serve.service

Step 6: Paste the following configuration into the service file:

[Unit]
Description=Kiwix-Serve
After=network.target

[Service]
Type=simple
User=YOUR-USERNAME
Group=YOUR-GROUP
WorkingDirectory=/opt/kiwix-serve/
ExecStart=/usr/local/bin/kiwix-serve --port=8000 --library=/path/to/the/kixwix/library-folder/
Restart=on-failure

[Install]
WantedBy=multi-user.target

In the [Service] section, replace the YOUR-USERNAME with your non-root user's username and YOUR-GROUP with the user's primary group.

In the ExecStart section, replace the --port value with the desired port number and --library with the path to the Kiwix content library folder.

Step 7: Save and close the file by pressing CTRL + S, then CTRL + X.

Step 8: Reload the systemd configuration and start the Kiwix-Serve service:

sudo systemctl daemon-reload
sudo systemctl start kiwix-serve

Step 9: Verify that Kiwix-Serve is up and running by checking the status:

sudo systemctl status kiwix-serve

You should see an output similar to this:

● kiwix-serve.service - Kiwix-Serve
   Loaded: loaded (/etc/systemd/system/kiwix-serve.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2021-11-07 12:34:56 UTC; 2s ago
 Main PID: 250054 (kiwix-serve)

Step 10: If you want Kiwix-Serve to start automatically upon boot, enable it using the following command:

sudo systemctl enable kiwix-serve

Conclusion

You have successfully installed Kiwix-Serve on Ubuntu Server Latest and configured it to serve your Kiwix content library. You can now access the content by navigating to http://SERVER-IP:PORT/ in your web browser or share the link with others. Keep in mind that you need to have your Kiwix content library downloaded and placed in the --library directory before Kiwix-Serve can serve it.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!