Running PouchDB Server on Android

Published 7 months ago: June 25, 2020


A how-to on getting PouchDB Server running on Android using Termux

PouchDB Server is a drop-in replacement for CouchDB, using PouchDB and Node.js. Termux is an Android terminal emulator and Linux environment app that works directly with no rooting or setup required. With the ability to run a linux terminal on Android, we can get a running instance of PouchDB Server on it.

Goal

Having a PouchDB Server running on your Android phone.

What you will need

An Android phone with Termux installed

Instructions

At the command line in Termux, run the commands below in the following order:

pkg install python
pkg install nodejs
npm -g install node-gyp
npm install -g pouchdb-server

A ton of warnings and errors may pop up. These can be ignored as long as we get it up and running successfully.

Finally, run:

pouchdb-server --sqlite

If it didn't work, install SQLite:

pkg install sqlite

If all goes well, the PouchDB Server admin interface should be available at http://localhost:5984/_utils, in any browser on your phone:

Some finishing notes

  • At first, PouchDB Server will only be available locally. To enable access from other devices connected to the same network access point, change configuration setting httpd bind_address to 0.0.0.0

  • It starts in admin party-mode (no authentication = open to any one editing.). Be sure to create an admin user if the server is made available on the network to prevent unintended access.