Skip to main content
Start with an app that already runs in your chat. Save its working setup so future work does not need to repeat dependency installation and configuration. If you have not run the app yet, start with Code with Replit.

What an environment contains

Replit builds a reusable image with the repository, runtime, tools, and dependencies needed for your app. New chats using the environment start from its latest successful build. Background builds run even when you are not chatting. They need approved workspace repository access through a GitHub App installation or GitLab group grant, separate from your personal connection. See Manage repository access.

Save the setup

Ask Replit to create a reusable environment from the working setup. Review the repositories, branch, tools, and setup steps before approving the build.
Replit can use what worked in the current chat, inspect repository instructions, and propose the tools and dependency steps to save. Confirm the branch to follow, usually main. You do not need to determine every installation command yourself. After the first successful build, Replit checks the application in a fresh sandbox. This checks that the saved setup works independently of the original chat’s running processes. Background builds need workspace repository access. Keep credential values out of build instructions and images.

Use it for future work

New sandboxes can start from a successful environment build. Updating a saved environment does not update a sandbox that is already running.

Understand refreshes

Successful rebuilds prepare updated code and dependencies for new sandboxes. A failed rebuild leaves the latest successful build available. Replit periodically rebuilds from the configured repository branch. A successful scheduled build prepares an updated image for future chats. For an existing sandbox, ask Replit to fetch and review current remote changes before editing. An environment refresh does not update work already in progress. Use Secrets for chat-only credentials or Add secrets to environments for reusable access. See Machine identities for provider trust.