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. This is a record of my experience, not a universal installation guide.
What I learned
For a local database setup, checking the installed software is only the beginning. You also need to verify that initialization works, that the server is accessible, and that SQL queries actually execute.
A smartphone can be an interesting environment for practicing SQL and backend concepts, even when a conventional development computer is unavailable.
Have you tried running a database on Android? What difficulties did you encounter?
This post was drafted with AI assistance from my own experiment notes. The experiment was performed by me.


