Skip to main content
Hostwares

How to Create a PostgreSQL Database in Supabase

sowad sheikh··2 min read

One of Supabase's main features is PostgreSQL. If your application needs persistent data, you can use the Supabase database instead of building a database layer from scratch.

Create a Supabase Project

Start by creating a Supabase project. Once the project is ready, open the database section.

Create a Table

You can create tables through Supabase Studio. For example, a simple products table might contain: id name price description created_at Choose appropriate data types for each column.

Add Relationships

If your application contains related data, PostgreSQL allows you to create relationships between tables. For example, an orders table can reference a users table.

Insert Data

After creating the table, add a few test records. This gives your application something to query during development.

Connect Your Application

Your application can connect to Supabase using the Supabase client library or the available APIs. Keep database credentials and sensitive configuration outside your source code.

Prepare for Production

Before using the database with real users, review your permissions and Row Level Security policies. This is particularly important for applications where users should only access their own data. If you want to run the complete Supabase stack on infrastructure you control, Hostwares also provides self-hosted Supabase deployments with dedicated resources.

Ready to deploy?

Launch your app on Hostwares — start for $1.00/mo with auto-scaling & global CDN.

Start for $1.00/mo

Ready to deploy? Start for $1.00/mo

Deploy now