The fastest way to get started is to ask Agent to add a database to your app. Agent will set up the integration, create the database schema, and update your app to store and retrieve data.

Features
The Replit Database tool provides the following features:- Database tools: Run queries, manage database schema, and visualize data with the built-in SQL tools
- Time travel: Restore your database to any Agent checkpoint using the rollback feature
- Free storage: Includes 10GB of free storage for every Replit App.
- Environment variables: Use environment variables in your Replit App to securely access the database
Prior to December 4th, 2025, the development database was hosted on Neon and has a few crucial differences.
See the Legacy Neon Development Database section for more details.
Usage
How to access the Replit Database tool
How to access the Replit Database tool
From the left Tool dock:
- Select
All tools to see a list of workspace tools.
- Select
Database.
- Select the
magnifying glass at the top to open the search tool
- Type “Replit Database” to locate the tool and select it from the results.
Add a database
All Replit Apps come with a database by default. You can access it by selecting theRestore your database to a previous state
You can revert your app and database to a previous state using the rollback feature. This feature allows you to restore your database to any checkpoint created by Agent or Assistant.
Make sure to select “Database” under “Additional rollback options” when restoring to the state of a checkpoint. This will restore your database to the state it was at the time of the checkpoint.
Run database commands
The SQL runner is a Workspace tool that lets you run SQL commands on your database and view the results.How to access SQL runner
How to access SQL runner
From the Replit Database tool:
- Select the My Data tab
- Select
SQL runner

Browse and modify data visually
The Replit Database tool includes Drizzle Studio, a tool that lets you browse and modify data visually. These visual tools help you avoid syntax errors and offer the following functionality:- Filter and sort data to focus on specific information
- Export data to a file for external use
- Insert or modify row data
- Create and manage schema, tables, views, and enums

View connection credentials and usage
Your database connection credentials are stored as environment variables in your Replit App. These credentials are used by your app to securely connect to the database and run commands.How to access your database connection credentials
How to access your database connection credentials
- Navigate to the
Replit Database tool in your workspace
- Select either the Development or Production database
- Select the
Settings tab (the gear icon). This tab shows the connection credentials and storage usage for your database.
Environment variables
The following environment variables are available:DATABASE_URL: how to connect and authenticate to the databasePGHOST: database hostnamePGUSER: database usernamePGPASSWORD: database passwordPGDATABASE: database namePGPORT: database port
DATABASE_URL can only be used by your app and even if leaked, it cannot be used by anyone else to access and modify your database.
To learn how to use these credentials in your code, see Connect your app to a SQL database.
Because this
DATABASE_URL is scoped to your app, your development database cannot be accessed by other apps, even ones you own or external database viewers.
This separation follows security best practices and prevents unauthorized access to your database.If you need multiple Replit Apps to share a single development database, see the guide on sharing a database across multiple Replit Apps.Security features
When you add a database integration using Agent, it adds an Object-Relational Mapper (ORM) that handles all database communications with built-in security. This ORM layer, combined with Agent’s security best practice implementation, protects your app from exploits through the following features:- Schema validation: Verifies data conforms to expected formats
- Data sanitization: Automatically cleans up builder input to prevent SQL injection attacks
Legacy Development Database
Prior to December 4th, 2025, the development database was hosted on Neon. This database is now deprecated and all new development databases are hosted on Replit’s own database infrastructure. You can see if your development database is hosted on Neon by checking theDATABASE_URL environment variable. If it contains neon.tech/neondb, then your development database is still hosted on Neon.
The following are the key differences between the legacy Neon development database and the new Replit development database:
| Feature | Helium (current) | Neon (legacy) |
|---|---|---|
| Hosting | Hosted on Replit’s own infrastructure | Hosted on Neon (third-party provider) |
| Billing | Included for free with every Replit App | Usage-based billing. See Publishing and Database Billing for more details. |
| Restore capability | Restore your database to any checkpoint using the rollback feature | Point-in-time restore (PITR)—recover to any point within backup retention window. |
| Connection security | Only accessible from within your app; never exposed publicly. | Used a full connection string—if leaked, anyone could access and modify your database. |
| Remixing behavior | Remixing creates a new development database with copied data for isolation and security. | Remixing reuses the same database for all copies, so changes in remixes could affect the original app. |
| Database creation | Automatically created for each Replit App. | Required explicit setup. |
| Publishing workflow | Deploying or publishing requires creating a production database for isolation between environments. | Development and production shared the same database, so unintended development changes could affect production apps. |