Note: Function collections are stored in supabase directory. Every edge function is represented as a directory: e.g. fetchurl
This guide provides step-by-step instructions to set up your environment, install necessary tools, and deploy Supabase Edge Functions.
First, update your system packages to ensure you have the latest versions:
sudo apt update
sudo apt upgrade -y
Homebrew requires some dependencies that may not be installed by default. Install them with the following command:
sudo apt install build-essential curl file git -y
Use the following command to download and install Homebrew. During the installation process, you may be prompted to confirm the installation and enter your password.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
To ensure Homebrew is available in your terminal sessions, you need to add it to your PATH. Open (or create) the ~/.profile
file and add the following lines:
# Add Homebrew to PATH
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
You can use nano
, vim
, or any other text editor to edit the file. Here’s an example using nano
:
nano ~/.profile
Add the same line as above in the ~/basrc
file:
nano ~/.bashrc
To apply the changes without logging out and back in, reload your profile with the following commands:
source ~/.profile
source ~/.bashrc
While Clang should be available with Homebrew installation, you can install it using apt-get if needed:
sudo apt-get install clang
Install the Supabase CLI using Homebrew:
brew install supabase/tap/supabase
First, login to Supabase through the terminal:
supabase login
Follow the link provided in the terminal if your browser does not open automatically.
The installation steps for Docker depend on your device. Please refer to the Docker installation guide for detailed instructions.
To create a new function, run the following command:
supabase functions new your-name
To deploy or update the function, run this command:
supabase functions deploy your-name --project-ref refkey
Additionally, you can test your functions locally with:
supabase functions serve
This completes the setup and deployment process for Supabase Edge Functions.