Need guidance for running the complete Supabase stack natively on Ubuntu (without Docker) #47908
Replies: 2 comments 1 reply
|
A
https://github.com/supabase/postgres/blob/15.8.1.085/Dockerfile-15 A PostgreSQL dump contains SQL definitions and data. It does not contain native extension libraries such as CREATE EXTENSION pg_net;but
The storage initialization script for this exact release is here: I would first restore again with error stopping enabled: psql -X --set ON_ERROR_STOP=on -f backup.sql postgresThat identifies the first real failure instead of continuing and producing hundreds of secondary errors. I would also compare the source and target databases: SELECT version();
SELECT extname, extversion
FROM pg_extension
ORDER BY extname;
SHOW shared_preload_libraries;To run PostgreSQL natively, you would need to reproduce the database environment from the tagged Supabase image:
GoTrue, PostgREST, Postgres Meta, and Kong are also not the entire Supabase stack. Depending on the features in use, the deployment may also require Storage API, Realtime, Supavisor, Functions, imgproxy, Logflare/Vector, and other services. The official self-hosting documentation currently recommends Docker, and I could not find an official procedure for installing this release as native Ubuntu packages managed by systemd: https://supabase.com/docs/guides/self-hosting A native installation is possible, but it means maintaining a custom PostgreSQL distribution yourself. The Nix and Ansible files in For a production migration, I would keep at least PostgreSQL on the matching |
|
The reason your Here is the step-by-step procedure to configure native Ubuntu 22.04 PostgreSQL so that your dump restores cleanly. Step 1: Install Build Dependencies & PostgreSQL Dev Headerssudo apt update
sudo apt install -y build-essential git cmake pkg-config postgresql-server-dev-15 \
libsodium-dev libcurl4-openssl-dev libssl-dev libpq-devStep 2: Build & Install Missing Supabase Extensions1.
|
Uh oh!
There was an error while loading. Please reload this page.
I am trying to run the complete Supabase stack without Docker on an Ubuntu 22.04 server. My goal is to install and manage each service natively using systemd.
Current Setup
My existing production environment is running with Docker:
PostgreSQL (supabase/postgres:15.8.1.085)
GoTrue (supabase/gotrue:v2.186.0)
PostgREST (postgrest/postgrest:v14.8)
Postgres Meta
Kong
On the new server:
Ubuntu 22.04.5 LTS
PostgreSQL 15.18 installed natively
GoTrue successfully built from source and runs correctly
PostgREST binary downloaded
PostgreSQL backup available (pg_dumpall SQL file)
Issue
When restoring the PostgreSQL backup into a native PostgreSQL installation, I receive errors about missing Supabase-specific objects, for example:
schema "net" does not exist
relation "storage.objects" does not exist
function extensions.algorithm_sign(...) does not exist
From inspecting the old Docker container, I found it includes extensions such as:
pg_graphql
pg_net
pgjwt
pgcrypto
supabase_vault
uuid-ossp
pg_stat_statements
It also uses PostgreSQL settings like:
wal_level = logical
shared_preload_libraries including pg_net, pgsodium, pg_cron, supabase_vault, etc.
I also cloned the supabase/postgres repository and checked out the 15.8.1.085 tag. I noticed the project uses Docker, Nix, and Ansible to build PostgreSQL, but I couldn't find installable PostgreSQL packages or documentation for installing the same environment directly on Ubuntu.
All reactions