<\/span><\/h2>\nFirst, you need to install a web server to run CouchDB. You can choose any web server that is available for Debian 9 and then install it on your server – however, in this tutorial we will use and install Nginx as our web server. By executing the following command, you can install the Nginx Web server on your VPS.<\/p>\n
apt install nginx<\/pre>\nWhen the installation is finished, you can start Nginx and also enable it to start on server boot with these commands.<\/p>\n
systemctl start nginx\r\nsystemctl enable nginx\r\n<\/pre>\nWe will now also install several dependencies that are needed in order to install CouchDB correctly and successfully.<\/p>\n
apt-get install apt-transport-https curl -y<\/pre>\n<\/span>Step 3: Download\/Enable the CouchDB Repository<\/span><\/h2>\nUnfortunately, CouchDB is not available in the pre-installed repositories found in Debian 9. We will add the official Apache CouchDB repository instead with the following command:<\/p>\n
echo \"deb https:\/\/apache.bintray.com\/couchdb-deb stretch main\" \\\r\n| sudo tee -a \/etc\/apt\/sources.list<\/pre>\nOnce that is done, we can then add the repository’s key with the following command:<\/p>\n
curl -L https:\/\/couchdb.apache.org\/repo\/bintray-pubkey.asc \\\r\n| sudo apt-key add -<\/pre>\nNow we can install CouchDB using our newly-installed repository.<\/p>\n
<\/span>Step 4: Install CouchDB<\/span><\/h2>\nSince we enabled the CouchDB repository in the previous step, we now need to update the repository cache and install the Apache CouchDB package:<\/p>\n
apt-get update && apt-get install couchdb<\/pre>\nDuring the installation, it will prompt you about which type of installation you prefer – standalone, or clustered:<\/p>\n
\r\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 Configuring couchdb \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\r\n \u2502 \u2502 \r\n \u2502 Please select the CouchDB server configuration type that best meets your \u2502 \r\n \u2502 needs. \u2502 \r\n \u2502 \u2502 \r\n \u2502 For single-server configurations, select standalone mode. This will set \u2502 \r\n \u2502 up CouchDB to run as a single server. \u2502 \r\n \u2502 \u2502 \r\n \u2502 For clustered configuration, select clustered mode. This will prompt for \u2502 \r\n \u2502 additional parameters required to configure CouchDB in a clustered \u2502 \r\n \u2502 configuration. \u2502 \r\n \u2502 \u2502 \r\n \u2502 If you prefer to configure CouchDB yourself, select none. You will then \u2502 \r\n \u2502 need to edit \/opt\/couchdb\/etc\/vm.args and \/opt\/couchdb\/etc\/local.d\/*.ini \u2502 \r\n \u2502 yourself. Be aware that this will bypass *all* configuration steps, \u2502 \r\n \u2502 including setup of a CouchDB admin user - leaving CouchDB in \"admin \u2502 \r\n \u2502 \u2502 \r\n \u2502 General type of CouchDB configuration: \u2502 \r\n \u2502 \u2502 \r\n \u2502 standalone \u2502 \r\n \u2502 clustered \u2502 \r\n \u2502 none \u2502 \r\n \u2502 \u2502 \r\n \u2502 <Ok> \u2502\r\n | |\r\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \r\n<\/pre>\nWe will choose the standalone type for this tutorial. Keep in mind that you may need to choose ‘clustered’, depending on your specific use case. For most cases, only a ‘standalone’ version of CouchDB is needed. Select it and press the [Enter] key to continue. Next, you will be asked to choose an interface bind address. We will select the default installation option.<\/p>\n
\r\n \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 Configuring couchdb \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\r\n \u2502 A CouchDB node must bind to a specific network interface. This is done \u2502 \r\n \u2502 via IP address. Only a single address is supported at this time. \u2502 \r\n \u2502 \u2502 \r\n \u2502 The special value '0.0.0.0' binds CouchDB to all network interfaces. \u2502 \r\n \u2502 \u2502 \r\n \u2502 The default is 127.0.0.1 (loopback) for standalone nodes, and 0.0.0.0 \u2502 \r\n \u2502 (all interfaces) for clustered nodes. In clustered mode, it is not \u2502 \r\n \u2502 allowed to bind to 127.0.0.1. \u2502 \r\n \u2502 \u2502 \r\n \u2502 CouchDB interface bind address: \u2502 \r\n \u2502 \u2502 \r\n \u2502 127.0.0.1_______________________________________________________________ \u2502 \r\n \u2502 \u2502 \r\n \u2502 <Ok> \u2502 \r\n \u2502 \u2502 \r\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \r\n<\/pre>\nNow we’ll need to choose a new password for the CouchDB admin user:<\/p>\n
\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 Configuring couchdb \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\r\n \u2502 It is highly recommended that you create a CouchDB admin user, \u2502\r\n \u2502\t\t\t\t\t\t\t\t\t\u2502\r\n \u2502 which takes CouchDB out of the insecure \"admin party\" mode. \t\u2502\r\n \u2502\t\t\t\t\t\t\t\t\t\u2502\r\n \u2502 Entering a password here will take care of this step for you. \u2502\r\n \u2502 \u2502 \r\n \u2502 If this field is left blank, an admin user will not be created. \u2502 \r\n \u2502 \u2502 \r\n \u2502 A pre-existing admin user will not be overwritten by this package. \u2502 \r\n \u2502 \u2502 \r\n \u2502 Password for the CouchDB \"admin\" user: \u2502 \r\n \u2502 \u2502 \r\n \u2502 *************_____________________________________________________ \u2502\r\n \u2502 \u2502 \r\n \u2502 <Ok> \u2502 \r\n \u2502 \u2502 \r\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\r\n<\/pre>\nRe-enter the password one more time:<\/p>\n
\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 Configuring couchdb \u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\r\n \u2502 \u2502\r\n \u2502 \u2502\r\n \u2502 Repeat password for the CouchDB \"admin\" user: \u2502\r\n \u2502 \u2502\r\n \u2502 ************__________________________________ \u2502\r\n \u2502 \u2502\r\n \u2502 <Ok> \u2502\r\n \u2502 \u2502\r\n \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\r\n<\/pre>\nOnce the installation is finished, we will start our new CouchDB instance and enable it to start on boot:<\/p>\n
systemctl start couchdb\r\nsystemctl enable couchdb<\/pre>\n