Merge pull request #148 from storminator89/main

Added tutorial install wikijs with docker compose in DE and EN
This commit is contained in:
Christoph 2023-12-21 11:15:10 +01:00 committed by GitHub
commit 27aab586f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 281 additions and 0 deletions

View file

@ -0,0 +1,143 @@
---
title: Installing Wiki.js via Docker Compose
description:
level: [intermediate]
updated_at: 2023-10-22
slug:
author_name: Patrick Meyhöfer
author_url: https://github.com/storminator89
author_image:
author_bio: Passionate developer with a keen interest in containerization and automation.
tags: [shell, ssh, linux, docker]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2948
language: en
available_languages: [de, en]
---
# Introduction
This tutorial will guide you through the process of installing Wiki.js using Docker Compose. By the end, you'll have a fully functional Wiki.js instance running in a Docker container.
The tutorial uses the example hostname `v11111111.quicksrv.de`. This hostname needs to be replaced by the name of your own server when you perform the workflow described in this tutorial.
# Requirements
- A Linux server
- Basic understanding of shell commands.
The smallest netcup server meets these requirements.
# Step 1 - Install Docker Compose
If you haven't installed Docker and Docker Compose on your server, use the following commands:
```bash
# Install Docker Compose
apt install docker-compose
```
# Step 2 - Create a Docker Compose file for Wiki.js
Create a new directory for your Wiki.js setup and navigate into it:
```bash
mkdir wikijs && cd wikijs
```
Now, create a `docker-compose.yml` file using your favorite text editor (e.g., `nano`):
```bash
nano docker-compose.yml
```
Paste the following text into that file:
```yaml
version: '3'
services:
db:
image: postgres:11-alpine
environment:
POSTGRES_DB: wiki
POSTGRES_USER: wikijs
POSTGRES_PASSWORD: wikijsrocks
volumes:
- db-data:/var/lib/postgresql/data
wiki:
image: requarks/wiki:2
depends_on:
- db
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: wikijs
DB_PASS: wikijsrocks
DB_NAME: wiki
ports:
- "80:3000"
volumes:
db-data:
```
In this configuration, we have defined the following parameters:
- We define the environmental variables to configure the PostgreSQL database.
- We map port 3000 inside the wiki container to port 80 on the host, making our Wiki.js instance accessible at http://v11111111.quicksrv.de.
- `environment`: List of environment variables set within the container.
- `POSTGRES_DB`: Name of the database to be created.
- `POSTGRES_USER`: Username for the database.
- `POSTGRES_PASSWORD`: Password for the database user.
- **Note**: You should replace the password `wikijsrocks` with a secure password of your choice.
- `DB_TYPE`: Type of the database, here `postgres`.
- `DB_HOST`: Hostname of the database. Since the database is within the same Docker network, we use the service name `db`.
- `DB_PORT`: Port of the database, default is `5432` for PostgreSQL.
- `DB_USER` and `DB_PASS`: Credentials to access the database. These should match the environment variables of the `db` service.
- `DB_NAME`: Name of the database to be used.
- `ports`: Determines which ports are forwarded from the host to the container.
- `80:3000`: Forwards port 80 of the host to port 3000 inside the container.
When using this Docker Compose file, you should as a minimum replace the database password with a secure password of your choice. All other configuration parameters can be adjusted according to your requirements and infrastructure.
# Step 3 - Starting the Wiki.js containers
Now, run the following command to start the Wiki.js and its database containers:
```bash
docker-compose up -d
```
This command will download the necessary images and start the containers in detached mode.
# Step 4 - Access the Wiki.js installation
Once the containers are up and running, open your web browser and navigate to your server's address, e.g., http://v11111111.quicksrv.de. You should see the Wiki.js setup wizard. Follow the on-screen instructions to complete the installation.
# Conclusion
Congratulations! You've successfully installed Wiki.js using Docker Compose. You can now start to effortlessly create and organize your documentation or knowledge base. However, remember to perform regular backups of your data and to keep your software up to date for security reasons.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.

View file

@ -0,0 +1,138 @@
---
title: Wiki.js mit Docker Compose installieren
description: Lernen Sie, wie Sie Wiki.js schnell und einfach mit Docker Compose auf Ihrem Linux-Server installieren können.
level: [intermediate]
updated_at: 2023-10-22
slug: wikijs-mit-docker-compose-installieren
author_name: Patrick Meyhöfer
author_url: https://github.com/storminator89
author_image:
author_bio: Passionate developer with a keen interest in containerization and automation.
tags: [shell, ssh, linux, docker]
netcup_product_url: https://www.netcup.de/bestellen/produkt.php?produkt=2948
language: de
available_languages: [de, en]
---
# Einleitung
Dieses Tutorial beschreibt, wie Sie Wiki.js mithilfe von Docker Compose installieren können. Nach erfolgreicher Installation verfügen Sie über eine voll funktionsfähige Wiki.js-Instanz, die in einem Docker-Container läuft.
Für dieses Tutorial wird der Beispiel-Hostname `v11111111.quicksrv.de` verwendet. Dieser Hostname muss durch den Namen Ihres eigenen Servers ersetzt werden, wenn Sie den in diesem Tutorial beschriebenen Workflow durchführen.
# Voraussetzungen
- Linux-Server mit installiertem Docker
- Grundkenntnisse in Shell-Befehlen.
Der einfachste VPS von netcup erfüllt diese Anforderungen.
# Schritt 1 - Docker Compose installieren
Wenn Sie Docker und Docker Compose noch nicht auf Ihrem Server installiert haben, verwenden Sie die folgenden Befehle:
```bash
# Docker Compose installieren
apt install docker-compose
```
# Schritt 2 - Erstellen Sie eine Docker Compose-Datei für Wiki.js
Erstellen Sie ein neues Verzeichnis für Ihre Wiki.js-Installation und wechseln Sie in das Verzeichnis:
```bash
mkdir wikijs && cd wikijs
```
Erstellen Sie jetzt eine `docker-compose.yml` Datei mit Ihrem bevorzugten Texteditor (z.B. `nano`):
```bash
nano docker-compose.yml
```
Fügen Sie den folgenden Text in die Datei ein:
```yaml
version: '3'
services:
db:
image: postgres:11-alpine
environment:
POSTGRES_DB: wiki
POSTGRES_USER: wikijs
POSTGRES_PASSWORD: wikijsrocks
volumes:
- db-data:/var/lib/postgresql/data
wiki:
image: requarks/wiki:2
depends_on:
- db
environment:
DB_TYPE: postgres
DB_HOST: db
DB_PORT: 5432
DB_USER: wikijs
DB_PASS: wikijsrocks
DB_NAME: wiki
ports:
- "80:3000"
volumes:
db-data:
```
In dieser Konfiguration ist folgendes enthalten:
- Wir leiten den Port 3000 innerhalb des Wiki-Containers zum Port 80 auf dem Host um, sodass unsere Wiki.js-Instanz unter http://v11111111.quicksrv.de erreichbar ist.
- `environment`: Liste von Umgebungsvariablen, die im Container gesetzt sind.
- `POSTGRES_DB`: Name der zu erstellenden Datenbank.
- `POSTGRES_USER`: Benutzername für die Datenbank.
- `POSTGRES_PASSWORD`: Passwort für den Datenbankbenutzer.
- **Hinweis**: Sie sollten das Passwort `wikijsrocks` durch ein sicheres Passwort Ihrer Wahl ersetzen.
- `DB_TYPE`: Typ der Datenbank, hier `postgres`.
- `DB_HOST`: Hostname der Datenbank. Da die Datenbank im selben Docker-Netzwerk ist, verwenden wir den Dienstnamen `db`.
- `DB_PORT`: Port der Datenbank, standardmäßig `5432` für PostgreSQL.
- `DB_USER` und `DB_PASS`: Anmeldedaten für den Zugriff auf die Datenbank. Diese sollten den Umgebungsvariablen des `db`-Dienstes entsprechen.
- `DB_NAME`: Name der zu verwendenden Datenbank.
- `ports`: Bestimmt, welche Ports vom Host zum Container weitergeleitet werden.
- `80:3000`: Leitet den Port 80 des Hosts an den Port 3000 im Container weiter.
Wenn Sie diese Docker Compose-Datei verwenden, sollten Sie zumindest das Datenbankpasswort durch ein sicheres Passwort Ihrer Wahl ersetzen. Alle anderen Konfigurationen können je nach Ihren Anforderungen und Ihrer Infrastruktur angepasst werden.
# Schritt 3 - Starten Sie den Wiki.js-Container
Führen Sie nun den folgenden Befehl aus, um Wiki.js und den dazugehörigen Datenbank-Container zu starten:
```bash
docker-compose up -d
```
Dieser Befehl lädt die notwendigen Images herunter und startet die Container im Hintergrundmodus.
# Schritt 4 - Zugriff auf die Wiki.js-Installation
Sobald die Container laufen, öffnen Sie Ihren Webbrowser und navigieren Sie zur Adresse Ihres Servers, z.B. http://v11111111.quicksrv.de. Sie sollten nun den Setup-Assistenten von Wiki.js sehen. Befolgen Sie die Anweisungen auf dem Bildschirm, um die Installation abzuschließen.
# Fazit
Herzlichen Glückwunsch! Sie haben Wiki.js erfolgreich mit Docker Compose installiert. Sie können nun Ihre Dokumentation oder Wissensdatenbank ganz mühelos erstellen und organisieren. Denken Sie aber daran, Ihre Daten regelmäßig zu sichern und Ihre Software aus Sicherheitsgründen aktuell zu halten.
# License
[MIT](https://github.com/netcup-community/community-tutorials/blob/main/LICENSE)
Copyright (c) 2021 netcup
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicence, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# Contributor's Certificate of Origin
By making a contribution to this project, I certify that:
1) The contribution was created in whole or in part by me and I have the right to submit it under the license indicated in the file; or
2) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same license (unless I am permitted to submit under a different license), as indicated in the file; or
3) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.
4) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the license(s) involved.