In this Tutorial you will learn how to Install CouchDB on Windows.
Facts to install CouchDB
- CouchDB is a highly concurrent document-oriented database which is written in Erlang.
- CouchDb is a part of the NoSQL database generation.
- It’s an Apache Foundation project that allows storing applications like JSON via the RESTful interface.
- Using map, reduces the index and makes a database query easier with CouchDB.
Installing CouchDB on Windows
There are two different methods of installing CouchDB on Windows operating system- Installing from sources and Installing from Binaries. Here we’ve discussed both of the methods in details with necessary steps
Method 1 of 2:
Installing CouchDB From Sources
Before starting the setup process, make sure you have these following installed in your PC
- OpenSSL (>0.9.8r)
- Erlang OTP (>=14B01,<R17)
- ICU (>=4.*)
- Mozilla SpiderMonkey(=1.8.5)
- Microsoft SDK 7.0 or 7.1
- Python(>=2.7) for docs
- Python Sphinx(>=1.1.3)
Also, ensure the following before starting and during the installation process
- Built the Erlang from source while installing the Erlang.
- When you’re installing Cygwin, make sure that you’ve selected all of the development tools.
- Remember, CouchDB needs several numbers of Erlang build scripts.
- It’s not good if you try to link against libraries that are built with MingW or Cygwin. Because MingW or Cygwin are not compatible with CouchDB build scripts or Erlang/OTP.
- Using MSBuild, ICU version 4.6 or further will be build cleanly.
- To build the online documentation, Python and Sphinx are alternative options instead. It’s better to use Cygwin-provided python and to install Sphinx by using easy_install or pip. Find more on this topic here.
Now, after you are done, you can go through these following steps orderly-
Step 1: Setting Up the Cygwin
Before starting to run Cygwin Terminal, run
To setup the environment, run
While running the code of environment setup, replace the [VS_BIN] with the path directory of your visual studio bin.
Now, after you are done, you need to check these followings
- The which link command points to the Microsoft Linker.
- The which cl command points to the Microsoft compiler.
- The which mc command points to the Microsoft message compiler.
- The which mt command points to the Microsoft manifest tool.
- The which nmake command points to Microsoft make tool.
Step 2: Building Erlang
At this stage, you must have Win32 OpenSQL which is built statistically from source. Also, exactly same versions need to be used as required by the build process of Erlang/OTP.
Now, if you want, you can skip the GUI tools by running
echo "skipping gs" > lib/gs/SKIP echo "skipping ic" > lib/ic/SKIP echo "skipping jinterface" > lib/jinterface/SKIP
Afterwards, follow these instructions to complete building Erlang successfully
Run the following
./otp_build release –a
Now, run this following
The process mentioned above will set up a destination and data directory for CouchDB installation. This will set up the release/win32/bin directory successfully.
Now, in order to set up the environment for building CouchDB, run
eval `./otp_build env_win32
In order to set up the ERL_TOP environment variable, run
Here, replace the [ERL_TOP] part with the name of the Erlang source directory. Also, don’t forget to use /cygdrive/c/ instead of c:/ as the directory prefix while replacing.
Finally, to setup the path, you run
Now, after you’ve successfully gone through the process, now it’s time to build the CouchDB.
Step 3: Build CouchDB
Before you start this step, keep in mind that you need to have win32-curl only if you want to run the developer test.
You can skip the documentation part by just running –disable-docs if you want to. Now, after satisfying the dependencies, run
./configure \ --with-js-include=/cygdrive/c/path_to_spidermonkey_include \ --with-js-lib=/cygdrive/c/path_to_spidermonkey_lib \ --with-win32-icu-binaries=/cygdrive/c/path_to_icu_binaries_root \ --with-erlang=$ERL_TOP/release/win32/usr/include \ --with-win32-curl=/cygdrive/c/path/to/curl/root/directory \ --with-openssl-bin-dir=/cygdrive/c/openssl/bin \ --with-msvc-redist-dir=/cygdrive/c/dir/with/vcredist_platform_executable \ --disable-init \ --disable-launchd \ --prefix=$ERL_TOP/release/win32
After you run, it will take some moments to execute the command. After completing this successfully, a message like the following will appear
You have configured Apache CouchDB, time to relax.
Now, after configuring, you need to install CouchDB. Run-
Now, if everything is done perfectly, a following message will appear
You have installed Apache CouchDB, time to relax.
Finally, to in order to build the re-installer package also, just run
As a alternative process, you can also run CouchDB from the build tree directly. But don’t run make dist after the process to avoid any kind of contamination.
Step 4: First Run CouchDB
To run VouchDb for the very first time, just run
If done successfully, the CouchDB will show this message
Apache CouchDB has started, time to relax.
Also, to check out the verification test and to check whether everything is working or not, follow this URL via Firefox or other web browsers-
Method 2 of 2: Install CouchDB from Binaries
Between the two described processes in this article, this one is easier to go. Few steps and selections will complete the whole installation process.
Let’s start with the steps
Now, at the installation wizard, go through these sub-steps-
- Click Next on the welcome screen.
- Accept the agreement of the license.
- Select the directory of installation.
- Specify a group name for the Start Menu.
- Approve the permission that, you are likely to install CouchDB as a service and the processes will automatically take place.
- Verify the Settings for Installation.
- Install CouchDB.
Now open Futton from http://localhost:5984/_utils”. Mind that, if you have not selected Autostart CouchDB, manually start it first to continue.
All done, now relax and enjoy!
Notes on Installation and Upgrading
- In some cases, you may be asked for permission to reboot the computer. Allow those processes.
- It’s strictly suggested to install CouchDB with the previous versions before upgrading.
- While upgrading, make sure you kept the backup files like ini config or CouchDB index/database files.
Tags: CouchDB, CouchDB Windows, installing couchdb, NoSQL