Menu

Running PostgreSQL on My Android Phone: What Worked and What Didn't
📰

Running PostgreSQL on My Android Phone: What Worked and What Didn't

DEV Community: postgres·user49324809·3 days ago
#QZPuyTGX
#devtopostgresql#devto#dev#database#termux
Reading 0:00
15s threshold

I wanted to find out whether I could practice working with a real database using only my Android phone.

My first attempt: Termux

I started with the Google Play version of Termux (googleplay.2026.10.09). The PostgreSQL client reported version 18.2.

I tried to initialize a database cluster:

initdb -D "$PREFIX/var/lib/postgresql"

Instead of a working database, I got an error:

postgres: Permission denied

This was an important distinction: having the PostgreSQL client installed did not mean that the database server could run successfully.

A working database

Later, I was able to work with PostgreSQL 18.2 in Smart IDE. I created a database and checked the current connection using:

SELECT current_database();

The query returned the database I had created.

I still cannot say exactly why the original Termux setup failed or whether switching Termux distributions would have fixed it.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.