From 013818b7d03eac7ca66bfe1a2c0b91bae505726d Mon Sep 17 00:00:00 2001 From: Jacques Faulkner Date: Wed, 25 Jun 2025 18:53:31 +0100 Subject: [PATCH 1/5] Update setup_own_server.md --- docs/setup_own_server.md | 53 +++++++++++++++++++++++++++++++++------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/docs/setup_own_server.md b/docs/setup_own_server.md index 9b0a471..b9e2c7a 100644 --- a/docs/setup_own_server.md +++ b/docs/setup_own_server.md @@ -21,7 +21,7 @@ --- ## 1. Prepare CouchDB -### A. Using Docker container +### A. Using Docker #### 1. Prepare ```bash @@ -37,28 +37,40 @@ mkdir couchdb-etc ``` #### 2. Run docker container - 1. Boot Check. ``` $ docker run --name couchdb-for-ols --rm -it -e COUCHDB_USER=${username} -e COUCHDB_PASSWORD=${password} -v ${PWD}/couchdb-data:/opt/couchdb/data -v ${PWD}/couchdb-etc:/opt/couchdb/etc/local.d -p 5984:5984 couchdb ``` -If your container has been exited, please check the permission of couchdb-data, and couchdb-etc. -Once CouchDB run, these directories will be owned by uid:`5984`. Please chown it for you again. +> [!WARNING] +> If your container has been exited, please check the permission of couchdb-data, and couchdb-etc. +> Once CouchDB run, these directories will be owned by uid:`5984`. Please chown it for you again. 2. Enable it in the background ``` $ docker run --name couchdb-for-ols -d --restart always -e COUCHDB_USER=${username} -e COUCHDB_PASSWORD=${password} -v ${PWD}/couchdb-data:/opt/couchdb/data -v ${PWD}/couchdb-etc:/opt/couchdb/etc/local.d -p 5984:5984 couchdb ``` -If you prefer a compose file instead of docker run, here is the equivalent below: + +Congrats, move on to [step 2](#2-run-couchdb-initsh-for-initialise) +### B. Using Docker Compose + +#### 1. Prepare + +``` +# Prepare directories which save data and configurations. +mkdir couchdb-data +mkdir couchdb-etc +``` + +#### 2. Create a `docker-compose.yml` file with the following added to it ``` services: couchdb: image: couchdb:latest container_name: couchdb-for-ols - user: 1000:1000 + user: 5984:5984 environment: - - COUCHDB_USER=${username} - - COUCHDB_PASSWORD=${password} + - COUCHDB_USER= #Please change as you like. + - COUCHDB_PASSWORD= #Please change as you like. volumes: - ./couchdb-data:/opt/couchdb/data - ./couchdb-etc:/opt/couchdb/etc/local.d @@ -66,7 +78,30 @@ services: - 5984:5984 restart: unless-stopped ``` -### B. Install CouchDB directly + +#### 3. Run the Docker Compose file to boot check + +``` +docker compose up +# Or if using the old version +docker-compose up +``` +> [!WARNING] +> If your container has been exited, please check the permission of couchdb-data, and couchdb-etc. +> Once CouchDB run, these directories will be owned by uid:`5984`. Please chown it for you again. + +### 4. Run the Docker Compose file in the background +If all went well and didn't throw any errors, `CTRL+C` out of it, and then run this command +``` +docker compose up -d +# Or if using the old version +docker-compose up -d +``` + +Congrats, move on to [step 2](#2-run-couchdb-initsh-for-initialise) + + +### C. Install CouchDB directly Please refer to the [official document](https://docs.couchdb.org/en/stable/install/index.html). However, we do not have to configure it fully. Just the administrator needs to be configured. ## 2. Run couchdb-init.sh for initialise From 4f1a9dc4e84cb7b1ecaa4220168dac1ee9454f73 Mon Sep 17 00:00:00 2001 From: Jacques Faulkner Date: Wed, 25 Jun 2025 18:54:22 +0100 Subject: [PATCH 2/5] Forgot a # --- docs/setup_own_server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/setup_own_server.md b/docs/setup_own_server.md index b9e2c7a..1b084f8 100644 --- a/docs/setup_own_server.md +++ b/docs/setup_own_server.md @@ -90,7 +90,7 @@ docker-compose up > If your container has been exited, please check the permission of couchdb-data, and couchdb-etc. > Once CouchDB run, these directories will be owned by uid:`5984`. Please chown it for you again. -### 4. Run the Docker Compose file in the background +#### 4. Run the Docker Compose file in the background If all went well and didn't throw any errors, `CTRL+C` out of it, and then run this command ``` docker compose up -d From 55cdc5885722476877d7bb8d358c328a3e5bf992 Mon Sep 17 00:00:00 2001 From: Jacques Faulkner Date: Thu, 26 Jun 2025 14:42:23 +0100 Subject: [PATCH 3/5] Edited warning to make a bit more sense --- docs/setup_own_server.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/setup_own_server.md b/docs/setup_own_server.md index 1b084f8..eb44c43 100644 --- a/docs/setup_own_server.md +++ b/docs/setup_own_server.md @@ -42,8 +42,8 @@ mkdir couchdb-etc $ docker run --name couchdb-for-ols --rm -it -e COUCHDB_USER=${username} -e COUCHDB_PASSWORD=${password} -v ${PWD}/couchdb-data:/opt/couchdb/data -v ${PWD}/couchdb-etc:/opt/couchdb/etc/local.d -p 5984:5984 couchdb ``` > [!WARNING] -> If your container has been exited, please check the permission of couchdb-data, and couchdb-etc. -> Once CouchDB run, these directories will be owned by uid:`5984`. Please chown it for you again. +> If your container threw an error or exited unexpectedly, please check the permission of couchdb-data, and couchdb-etc. +> Once CouchDB starts, these directories will be owned by uid:`5984`. Please chown it for that uid again. 2. Enable it in the background ``` @@ -87,8 +87,8 @@ docker compose up docker-compose up ``` > [!WARNING] -> If your container has been exited, please check the permission of couchdb-data, and couchdb-etc. -> Once CouchDB run, these directories will be owned by uid:`5984`. Please chown it for you again. +> If your container threw an error or exited unexpectedly, please check the permission of couchdb-data, and couchdb-etc. +> Once CouchDB starts, these directories will be owned by uid:`5984`. Please chown it for that uid again. #### 4. Run the Docker Compose file in the background If all went well and didn't throw any errors, `CTRL+C` out of it, and then run this command From 39340c1e1b18a8759ecb2936a7fb3e738041473e Mon Sep 17 00:00:00 2001 From: Jacques Faulkner Date: Thu, 26 Jun 2025 14:45:04 +0100 Subject: [PATCH 4/5] Sorry 1 more, reworded the creating directories comments --- docs/setup_own_server.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/setup_own_server.md b/docs/setup_own_server.md index eb44c43..ad24559 100644 --- a/docs/setup_own_server.md +++ b/docs/setup_own_server.md @@ -26,12 +26,12 @@ #### 1. Prepare ```bash -# Prepare environment variables. +# Adding environment variables. export hostname=localhost:5984 export username=goojdasjdas #Please change as you like. export password=kpkdasdosakpdsa #Please change as you like -# Prepare directories which save data and configurations. +# Creating the save data & configuration directories. mkdir couchdb-data mkdir couchdb-etc ``` @@ -56,7 +56,7 @@ Congrats, move on to [step 2](#2-run-couchdb-initsh-for-initialise) #### 1. Prepare ``` -# Prepare directories which save data and configurations. +# Creating the save data & configuration directories. mkdir couchdb-data mkdir couchdb-etc ``` From 341f0ab12df6cb4c6dfb03890784be74bf878472 Mon Sep 17 00:00:00 2001 From: Jacques Faulkner Date: Fri, 27 Jun 2025 10:39:13 +0100 Subject: [PATCH 5/5] Updated Table of Contents --- docs/setup_own_server.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/setup_own_server.md b/docs/setup_own_server.md index ad24559..eacb678 100644 --- a/docs/setup_own_server.md +++ b/docs/setup_own_server.md @@ -5,10 +5,15 @@ - [Setup a CouchDB server](#setup-a-couchdb-server) - [Table of Contents](#table-of-contents) - [1. Prepare CouchDB](#1-prepare-couchdb) - - [A. Using Docker container](#a-using-docker-container) + - [A. Using Docker](#a-using-docker) - [1. Prepare](#1-prepare) - [2. Run docker container](#2-run-docker-container) - - [B. Install CouchDB directly](#b-install-couchdb-directly) + - [B. Using Docker Compose](#b-using-docker-compose) + - [1. Prepare](#1-prepare-1) + - [2. Creating Compose file](#2-create-a-docker-composeyml-file-with-the-following-added-to-it) + - [3. Boot check](#3-run-the-docker-compose-file-to-boot-check) + - [4. Starting Docker Compose in background](#4-run-the-docker-compose-file-in-the-background) + - [C. Install CouchDB directly](#c-install-couchdb-directly) - [2. Run couchdb-init.sh for initialise](#2-run-couchdb-initsh-for-initialise) - [3. Expose CouchDB to the Internet](#3-expose-couchdb-to-the-internet) - [4. Client Setup](#4-client-setup)