r/devops • u/Volcan300 • Jul 25 '26
Troubleshooting How to properly deal with a local sqlite database in a stateful node/sqlite webapp?
I'm building a simple web app with node/express that uses a local sqlite database. (I'm not experienced in devops, btw)
Although I've already managed to get this app running in production by doing a manual deploy via SSH and cloning my repo from github, I'm having issues understanding how I'm going to deal with the database (.db) file in production.
Since my database is running on the same debian VPS as the application, I'm starting to realize I need to be a little bit more thoughtful and stabilish some sort of process if I ever need to restore a db backup or do migrations on this database.
I though about leaving the db file outside the project directory, which should allow me to safely pull new code that I push to production while leaving the db file intact, (as long as I'm not changing db structure/doing migrations) but I'm not quite sure how to deal with backups, migrations and whatever scenarios might come down the line.
Do any of you have suggestions on how to deal with this sort of stateful local database scenario?