Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Local development and self hosting. Preparing for the CLI launch

Paul Copplestoned376fefa7bab
diff --git a/web/docs/guides/self-hosting.mdx b/web/docs/guides/self-hosting.mdx
new file mode 100644
index 00000000000..f1b616d1670
--- /dev/null
+++ b/web/docs/guides/self-hosting.mdx
@@ -0,0 +1,130 @@
+---
+id: self-hosting
+title: Local Development and Self Hosting
+description: How to use.
+---
+
+
+You can develop an application either locally and deploy to a service of your choice, or using our hosted platform.
+
+## Local development
+
+Local development (will be released 1 April). Our CLI makes heavy use of [Docker](https://www.docker.com/), so make sure it is installed and configured on your machine before starting.
+
+### Install our CLI
+
+```bash
+npm install -g supabase
+```
+
+### Initialize your project
+
+```bash
+supabase init
+```
+
+This command will create a `.supabase` folder which holds all the configuration for developing your project locally.
+
+### Start
+
+```bash
+supabase start
+```
+
+This command uses Docker Compose to start all the services that make up Supabase. You can find the full Docker Compose [in our repo](https://github.com/supabase/supabase/blob/master/docker).
+
+### Stop
+
+```bash
+supabase stop
+```
+
+## Self hosting
+
+Every Supabase project is an amalgamation of open source tools. We provide a [Docker Compose](https://github.com/supabase/supabase/blob/master/docker) setup which makes it simple to get started.
+
+
+### Get the Docker Compose
+
+
+You can download this Docker set up to your local machine in various ways:
+
+#### Using our CLI (will be released 1 April).
+
+```bash
+supabase eject
+```
+
+Run this in any folder to create a `docker` folder with a `docker-compose.yml`
+
+#### Clone our repo
+
+```bash
+# 1. Copy an empty repo
+git clone https://github.com/supabase/supabase
+
+# 2. Move into the empty repo
+cd supabase/docker
+```
+
+#### Using a shallow clone
+
+If you use Git version >2.25, you can use a shallow clone to download this folder to your local machine:
+
+```bash
+# 1. Copy an empty repo
+git clone --no-checkout https://github.com/supabase/supabase
+
+# 2. Move into the empty repo
+cd supabase
+
+# 3. Initialize sparse-checkout
+git sparse-checkout init --cone
+
+#4. Checkout the folder
+git sparse-checkout set docker
+```
+
+### Running Supabase
+
+Now that you have the Docker set up on your local machine, you can start it here by running
+
+```bash
+docker-compose up
+```
+
+### Configuring each service
+
+Supabase is made up of several services. We have prefilled the `docker-compose` file with all the configuration you need to get started.
+If you would like to change any of the configuration, you can update the env variables in the `docker-compose` file.
+
+Here are a list of environment variables for each service:
+
+- [Postgres](https://hub.docker.com/_/postgres/)
+- [PostgREST](https://postgrest.org/en/v7.0.0/configuration.html)
+- [Realtime](https://github.com/supabase/realtime#server-set-up)
+- [GoTrue](https://github.com/supabase/gotrue)
+- [Kong](https://docs.konghq.com/install/docker/)
+
+
+## One-click deploys
+
+For some individual tools, we also provide images and deployments into cloud marketplaces:
+
+### Postgres
+
+- AWS (Arm architecture) [one click deploy](https://aws.amazon.com/marketplace/pp/B08V22HK26?qid=1617156168590&sr=0-3)
+- AWS [one click deploy](https://aws.amazon.com/marketplace/pp/B08915TCJ2)
+- Digital Ocean [one click deploy](https://marketplace.digitalocean.com/apps/supabase-postgres)
+- Docker [image](https://hub.docker.com/r/supabase/postgres)
+
+### Realtime
+
+- AWS [one click deploy](https://aws.amazon.com/marketplace/pp/B089N4FH7N?qid=1617156168590&sr=0-2)
+- Digital Ocean [one click deploy](https://marketplace.digitalocean.com/apps/supabase-realtime)
+- Docker [image](https://hub.docker.com/r/supabase/postgres)
+
+## Next steps
+
+- Got a question? [Ask here](https://github.com/supabase/supabase/discussions).
+- Sign in: [app.supabase.io](https://app.supabase.io)
diff --git a/web/sidebars.js b/web/sidebars.js
index 9168e5b3ddf..17a80c50c39 100755
--- a/web/sidebars.js
+++ b/web/sidebars.js
@@ -58,7 +58,12 @@ module.exports = {
// },
],
docs: [
- { type: 'category', label: 'Introduction', items: ['about', 'faq'], collapsed: false },
+ {
+ type: 'category',
+ label: 'Introduction',
+ items: ['about', 'faq'],
+ collapsed: false,
+ },
{
type: 'category',
label: 'Getting Started',
@@ -69,6 +74,7 @@ module.exports = {
'guides/auth',
'guides/storage',
'guides/client-libraries',
+ 'guides/self-hosting',
],
},
{