How to install latest CouchDB on Ubuntu 12.04, 14.04, 15.04, 15.10, 16.04, etc?
I spent around an hour trying different ways and instructions for installing latest CouchDB on my Ubuntu 12.4 installation. I have posted the best way that I found as answer to save other peoples time.
5 Answers
Install the latest stable release with the commands below:
sudo apt-get remove couchdb couchdb-bin couchdb-common -f
sudo apt-get install python-software-properties
sudo apt-add-repository ppa:couchdb/stable
sudo apt-get update
sudo apt-get install couchdb couchdb-bin couchdb-common -f 4 Run this script:
cd /tmp
mkdir x
cd x
set -e
sudo apt-get update || true
sudo apt-get --no-install-recommends -y install build-essential pkg-config runit erlang libicu-dev libmozjs185-dev libcurl4-openssl-dev
wget
tar -xvzf apache-couchdb-2.0.0.tar.gz
cd apache-couchdb-2.0.0/
./configure && make release
sudo adduser --system \ --no-create-home \ --shell /bin/bash \ --group --gecos \ "CouchDB Administrator" couchdb
sudo cp -R rel/couchdb /home/couchdb
sudo chown -R couchdb:couchdb /home/couchdb
sudo find /home/couchdb -type d -exec chmod 0770 {} \;
sudo sh -c 'chmod 0644 /home/couchdb/etc/*'
sudo mkdir /var/log/couchdb
sudo chown couchdb:couchdb /var/log/couchdb
sudo mkdir /etc/sv/couchdb
sudo mkdir /etc/sv/couchdb/log
cat > run << EOF
export HOME=/home/couchdb
exec 2>&1
exec chpst -u couchdb /home/couchdb/bin/couchdb
EOF
cat > log_run << EOF
exec svlogd -tt /var/log/couchdb
EOF
sudo mv ./run /etc/sv/couchdb/run
sudo mv ./log_run /etc/sv/couchdb/log/run
sudo chmod u+x /etc/sv/couchdb/run
sudo chmod u+x /etc/sv/couchdb/log/run
sudo ln -s /etc/sv/couchdb/ /etc/service/couchdb
sleep 5
cd /tmp/x/apache-couchdb-2.0.0
sudo sv status couchdb mv rel/couchdb /usr/local/bin/
cd ..
rm -r /tmp/x
cat <<EOT >> /etc/systemd/system/couchdb.service
[Unit]
Description=Couchdb service
After=network.target
[Service]
Type=simple
User=couchdb
ExecStart=/usr/local/bin/couchdb/bin/couchdb -o /dev/stdout -e /dev/stderr
Restart=always
EOT
systemctl daemon-reload
systemctl start couchdb.service
systemctl enable couchdb.service
service couchdb startthen open the url
- Download the latest Source package of CouchDB from couchdb.apache.org and extract it
- Open INSTALL.Unix or any other appropriate readme or install file
- RTFM™ and follow instructions, install unmet dependencies if any and Relax!™
While this post is not focused on Ubuntu (but rather debian on a Raspberry Pi), I was successful in following these guidelines on Ubuntu:
Outline:
- Add Erlang repositories to your package manager
- Install Erlang
- Install spidermonkey
- Install libicu
- Install curl
- Set up user account for CouchDB
- Download CouchDB source code
- Do configure/make/make install
- Create soft links
- Make CouchDB config writable
Just try to use snap to install CouchDB.Only 2 commands needed.
sudo apt install snapd
sudo snap install couchdbSource: Stack Overflow