Deploy Your Own NocoDB on Railway
NocoDB is an interesting new OSS project that's easy to deploy for free on Railway!
NocoDB is an interesting open source project I came across some weeks ago; it aims to be an OSS alternative to Airtable. Airtable is a "nocode" solution for line-of-business applications, focusing on business process automation. It's like an enterprisey IFTTT (although; IFTTT would probably want you to think of them as the enterprisey IFTTT). NocoDB is in its early stages but seems to want to occupy the same niche, but there's a couple differences that make it useful to me for other purposes.
Crucially, it's built as a UI wrapper around a database of your choice. Their documentation is a bit sparse right now, but I think I'm right in saying they support Postgres, MySQL, and SQLite at the time of this writing. If you've read my work before, you know that I like Postgres. There's a lot of UIs you can use with Postgres, even some that have fancy visualizations like this NocoDB, but the difference with NocoDB that's impressed me is in their support for automation: by developing their software into the no/low-code niche, it becomes more useful for those cases where I just need to set up some trigger here or interaction there.
I've been wanting to replace all my spreadsheets with Postgres for a while now, and NocoDB might just be the UI that lets me do that. Being OSS, I can deploy it myself with my own Postgres database for free! Here I'm going to outline how that's done in Railway, my preferred cloud host. The relevant docs from NocoDB are their Docker install and environment variables.
The setup will be quite simple: we'll just need a Postgres database and a Docker container (with a volume) for NocoDB. We'll start by creating an empty project:
To which we can add a Postgres database:
I was fine with the default Postgres settings, but feel free to change yours how you need.
Creating the NocoDB container is easy enough; the image nocodb/nocodb:latest
is available from docker hub. We can create the container by selecting Docker Image
when we go to create the container:
and entering the image name
You can deploy this now if you like, but we're going to want to attach a volume and connect it to Postgres to work. To attach the volume, right-click on the NocoDB container:
And mount the volume to /usr/app/data/
In order to connect to the postgres database, we can set the NC_DB
variable on the NocoDB container. You can click on the container and then the Variables tab:
Railway has support for referencing other services in its environment variables, which we can take advantage of in constructing our connection string. When I added my variable, I used the following to get a connection string in the format that matches NocoDB's docs:
pg://${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:${{Postgres.PGPORT}}?u=${{Postgres.PGUSER}}&p=${{Postgres.PGPASSWORD}}&d=${{Postgres.PGDATABASE}}
That's all we need now in order to deploy and check that we're successful. Once that's verified, you can configure a public URL for your NocoDB container and start using it!