Exporting your code
Download your project as a source archive and keep building locally or self-host.
You own the code Layout generates. Export pulls a full source archive of any version so you can run it locally, push it to your own Git host, or deploy it anywhere.
Prerequisites
- An active paid subscription. Exporting is not available on the free plan.
- A project with at least one successful version
If your subscription lapses, past exports still work, but the download endpoint stops issuing new archives until you resubscribe.
Steps
Load the version you want to export
By default the preview shows the latest build, which is what most people export. If you want an older snapshot, open version history (clock icon), click a row, and the preview switches to that version. The download button always exports whichever version is loaded.
Click the download icon
In the preview header, click the down-arrow Download code icon. Layout generates a short-lived signed URL and starts the download.
The archive is a .tar.gz file named project-<id>-<version>.tar.gz.
On the free plan the icon is disabled and hovering it shows an upgrade tooltip. Subscribe from Billing to enable downloads.
Extract and open
Extract the archive:
tar -xzf project-<id>-<version>.tar.gz
cd project-<id>-<version>Open it in your editor. The project follows standard Next.js conventions, so anything that reads Next.js projects will understand it.
What the archive contains
- The complete source tree as the AI last generated it
package.jsonwith every dependency pinnedsupabase/migrations if your project uses Supabase- Any uploaded assets bundled into
public/
It does not contain:
node_modules— runnpm installlocally- Environment variables — Layout never bakes secrets into the archive
- Your Supabase database rows — the schema travels, the data does not
Run it locally
Install dependencies
npm installSet environment variables
Create a .env.local file with your Supabase URL and anon key. If you used the managed Supabase project, grab those from the Supabase dashboard after connecting your own project. See Working with Supabase.
NEXT_PUBLIC_SUPABASE_URL=https://<project-id>.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=<your-anon-key>Run the dev server
npm run devOpen http://localhost:3000. You should see the same app as the Layout preview.
Deploy anywhere
The exported project is a standard Next.js app. It runs on:
- Vercel — connect the Git repo, set the env vars, ship
- Netlify — same flow with the Next.js runtime
- AWS, Fly, Render, your own server — any host that runs Node.js
Nothing in the archive is Layout-specific at runtime.
What breaks off-platform
A few things stop working once you leave Layout.
Export for backup, not for forking
Export is useful as a safety net and as a way to go self-hosted. It is not a great way to fork a project and keep building in parallel on Layout. If you want two branches, clone the project inside Layout instead — see Editing your project.