Self host Supabase with an Ubuntu Server on Digital Ocean
Table of Contents
Tutorial: Self-host Supabase with an Ubuntu Server on Digital Ocean
Step 1: Set Up Server with Docker and Docker Compose
1.1. Visit the DigitalOcean marketplace and select the Docker image for installation. 1.2. Create a droplet and wait for it to be set up. 1.3. Connect the droplet to your domain by updating the IP address. 1.4. Turn off the proxy as Supabase will handle it.
Step 2: Configure Environment Variables
2.1. Give the user pseudo privileges by setting up the Super Base user. 2.2. Configure the Window Manager for multiple windows and to keep the SSH connection alive. 2.3. Set up the supervisor repository and generate necessary values as per the official guide.
Step 3: Database Configuration
3.1. Generate a new key for the database password. 3.2. Copy and save the generated key. 3.3. Disable the Anon key and service role key in the configuration.
Step 4: Email Authentication Configuration
4.1. Set up variables for email authentication. 4.2. Paste the configuration in the designated section. 4.3. Set the public rest URL and API external URL for public access.
Step 5: Installation and Permission Setup
5.1. Copy your IP address for installation. 5.2. Start the installation process. 5.3. If a permission error occurs, troubleshoot and ensure access to Port 3000 for the installation.
Step 6: Connect to User Management Sample
6.1. Enter the service URL for the user management sample. 6.2. Restart the project if needed.
Step 7: Initialize the Database
7.1. Use an SQL editor to initialize the database. 7.2. Verify the tables are created successfully.
Step 8: Verify Installation and Custom Domain Setup
8.1. Access the installation and verify functionality. 8.2. Install the Caddy server for custom domain usage. 8.3. Edit the Caddy file to configure the domain. 8.4. Update the API external URL and public rest URL for the custom domain.
Step 9: Final Checks and Testing
9.1. Run Docker compose up to reload containers with updated settings. 9.2. Confirm access to default projects and the updated configuration. 9.3. Test the database and profiles table functionality with the custom domain.
Step 10: Conclusion
10.1. Verify that everything is working as expected. 10.2. Leave a tip if you found the tutorial helpful.
By following these steps, you can successfully self-host Supabase with an Ubuntu server on Digital Ocean and configure it with a custom domain for SSL support.