• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How to Install Supabase on Ubuntu Server (with Docker)

By Abhishek Ghosh June 11, 2023 9:13 am Updated on June 11, 2023

How to Install Supabase on Ubuntu Server (with Docker)

Advertisement

In our earlier guide, we discussed installation of AppWrite on own server. If you are developing ESP32 Arduino, then probably Supabase will feel more like Firebase.

Apart from Firebase, AppWrite, and Supabase, there are other options such as AceBase, Amplication, Conduit and so on. Supabase is one the most established BaaS provider among the three. In a sense, Supabase is nearly an equivalent which is very close to Appwrite. Supabase supports PostgreSQL, the opposite of the NoSQL approach in Appwrite. Regarding the cloud-hosted version of Supabase, it has a Free plan which is enough to test the IoT projects with ESP32 Arduino.

Supabase has an existing library for ESP32 (Arduino IDE):

Advertisement

---

Vim
1
https://github.com/jhagas/ESP32-Supabase

Also, there are a few tutorials:

Vim
1
https://www.jhagas.space/posts/monitoring-data-logging-sensor-iot-supabase

So the total thing is easier for a less advanced developer or a student. All the others including AppWrite are similar. You need something like Svelte or Netlify to deploy them. You can extend the functions by adding a notification system such as Novu. If you use all of them as cloud-hosted, you have no headache with backend management.

What we have done here in this guide ESP32 Arduino IoT Relay Control, can be done more professionally with these systems.

 

Steps to Install Supabase

 

You need a sub-domain or domain to complete the installation. First update, upgrade your server:

Vim
1
sudo apt update && sudo apt upgrade

Install the required packages and apps:

Vim
1
sudo apt install nano git ufw software-properties-common dirmngr apt-transport-https gnupg2 ca-certificates lsb-release debian-archive-keyring -y

Install Docker and Docker compose plugin:

Vim
1
2
3
4
5
sudo apt-get install docker.io  
sudo apt install docker-compose-plugin
sudo systemctl start docker  
sudo systemctl enable docker  
docker -v

Clone the Supabase repository from GitHub:

Vim
1
git clone --depth 1 https://github.com/supabase/supabase

Open the .env file:

Vim
1
nano .env

These default settings require changing:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
## General
SITE_URL=http://localhost:3000
ADDITIONAL_REDIRECT_URLS=
JWT_EXPIRY=3600
DISABLE_SIGNUP=false
API_EXTERNAL_URL=http://localhost:8000
 
## Mailer Config
 
...
...
 
############
# Studio - Configuration for the Dashboard
############
 
STUDIO_DEFAULT_ORGANIZATION=Default Organization
STUDIO_DEFAULT_PROJECT=Default Project
 
STUDIO_PORT=3000
# replace if you intend to use Studio outside of localhost
SUPABASE_PUBLIC_URL=http://localhost:8000

Also edit POSTGRES_PASSWORD, JWT_SECRET etc fields.

Here you’ll get some info about this file:

Vim
1
https://supabase.com/docs/guides/functions/secrets#production-secrets

Open the official Supabase website on the browser – https://supabase.com/docs/guides/self-hosting#api-keys
… and enter that JWT_SECRET to generate ANON_KEY. In the same way, generate the SERVICE_KEY.

Open docker-compose.yml and edit the API_EXTERNAL_URL and GOTRUE_SITE_URL to ${SITE_URL}. Open volumes/api/kong.yml and find:

Vim
1
2
3
4
consumers:
  - username: anon
    keyauth_credentials:
      - key:

The key value will be ANON_KEY.

find:

Vim
1
2
3
- username: service_role
    keyauth_credentials:
      - key:

The key value will be SERVICE_KEY.

Change the directory to the repository’s Docker subdirectory:

Vim
1
cd supabase/docker

Copy the included configuration file:

Vim
1
cp .env.example .env

Now, run Supabase within the supabase/docker subdirectory:

Vim
1
sudo docker compose up -d

Next, install NGINX, follow any of our guides on installation of NGINX and/or Certbot.

How to Install Supabase on Ubuntu Server

You need to edit the configuration file at /etc/nginx/sites-available/default. The configuration should look like this one after your editing:

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}
 
upstream supabase {
    server localhost:3000;
}
 
upstream kong {
    server localhost:8000;
}
 
server {
    listen 80;
    server_name localhost x.y.z.a example.com;
 
    # REST
    location ~ ^/rest/v1/(.*)$ {
        proxy_set_header Host $host;
        proxy_pass http://kong;
        proxy_redirect off;
    }
 
    # AUTH
    location ~ ^/auth/v1/(.*)$ {
        proxy_set_header Host $host;
        proxy_pass http://kong;
        proxy_redirect off;
    }
 
    # REALTIME
    location ~ ^/realtime/v1/(.*)$ {
        proxy_redirect off;
        proxy_pass http://kong;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
        proxy_set_header Host $host;
    }
 
    # STUDIO
    location / {
        proxy_set_header Host $host;
        proxy_pass http://supabase;
        proxy_redirect off;
        proxy_set_header Upgrade $http_upgrade;
    }
}

Run nginx -t and restart NGINX. You need to edit /etc/nginx/nginx.conf later for optimization (search or site for articles on NGINX optimization).

After completion, you will be able to log in to Supabase.

Supabase requires some Postgres extensions to be enabled for the API and Auth system to work. Read the official direction on this webpage under Extension sub-header – https://supabase.com/docs/guides/self-hosting.

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How to Install Supabase on Ubuntu Server (with Docker)

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • How Setup Private Docker Registry on Ubuntu 16.04 LTS Cloud Server

    You Can Have Your Own Docker Registry on Own Cloud Server Instance. Here is How Setup Private Docker Registry on Ubuntu 16.04 LTS Cloud Server.

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

  • How to Install WordPress : Ubuntu 16.04, Nginx, PHP7-FPM

    Here is Step by Step Guide on How to Install WordPress on Ubuntu 16.04, Nginx, PHP7-FPM, memcached & Percona MySQL 5.7 on Cloud Server or VPS.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy