Run a Replit Agent app on your computer
An app from Replit Agent is a pnpm workspace with an Express API, a Vite web app and shared code. On Replit a router and a few Replit services start the parts and connect them. On your computer you do that yourself.
What Replit Agent builds
In November 2026 we had Replit Agent build a small project board: Replit Auth for logins, PostgreSQL for projects and tasks and an avatar upload to App Storage. The repository had this layout:
| Folder | What is in it |
|---|---|
| artifacts/api-server | The Express 5 API |
| artifacts/ and the name of your app | The React web app, built with Vite |
| lib/db | The tables, written with Drizzle ORM |
| lib/api-spec | The OpenAPI file the API client code is generated from |
| lib/replit-auth-web | The login code the web app uses |
The .replit file in the root tells Replit how to run all of it. Your computer does not read that file.
1. Push it to GitHub and clone it
In Replit, open Tools, then Git. Click Create Remote, keep Private and click Create Repository on GitHub. Replit asks if it may use your GitHub login for this session. Confirm, then click Push branch as origin/main. Then copy the repository to your computer:
gh repo clone your-name/your-repo
2. Install with pnpm
npm install stops with "Use pnpm instead". If pnpm is not installed, use corepack. It comes with Node.js and runs the pnpm version the project asks for. The project was set up for Node.js 24.
corepack pnpm install
3. Add the variables
On Replit the workspace gives the app its variables. On your computer they go in a .env file in the root. The API reads these:
| Variable | What it is for | Where it comes from |
|---|---|---|
| DATABASE_URL | The database. The API stops at startup without it | Replit, Tools, Database, Settings |
| REPL_ID | The client ID of the Replit login | Replit sets it in the workspace |
| PRIVATE_OBJECT_DIR and PUBLIC_OBJECT_SEARCH_PATHS | Where App Storage keeps uploads | Replit sets them in the workspace |
| PORT | The port each part listens on | You pick it |
| BASE_PATH | The path the web app runs under | / on your computer |
The .gitignore that Replit Agent wrote does not list .env. Add it before you put a real password in the file:
echo .env >> .gitignore
4. Start the API and the web app
Run each part in its own terminal, from the root of the project. Put the name of your web app folder in place of boardly. If pnpm is not on your PATH, put corepack in front of it.
PORT=5000 pnpm --filter @workspace/api-server run dev
PORT=5173 BASE_PATH=/ pnpm --filter @workspace/boardly run dev
On Replit a router sends every /api request to the API. On your computer nothing does, so the web app loads and gets no data. Ask your AI tool to add a Vite proxy that sends /api to http://localhost:5000.
What only works on Replit
Replit Auth logs people in through replit.com/oidc with the REPL_ID of the workspace. App Storage gets its access from a Replit service at 127.0.0.1:1106. Neither exists on your computer, so logins and uploads fail there. Test them in the Replit preview, or replace them when the app leaves Replit.
Or let an AI tool do it
Paste this into Claude Code or Codex in the project folder:
Install the dependencies of this project and start the dev server. On Replit the app gets its environment variables from Replit. Here they are in .env, so load that file when you start it. Do not change how the app runs on Replit. Give me the local address.
In our test, without a .env file, Claude Code installed the packages, listed the variables the API needs and stopped. It did not guess the values.
Sources
- Replit docs: Version control
- Replit docs: Add a database
- Node.js docs: Corepack
- Vite docs: server.proxy