Anticode Open builder

Deploy AI website to Netlify: a dropped folder or a Next.js build

Anticode gives you two exports, and Netlify can host either. The HTML export is static files you can drop onto Netlify in a minute, but its forms have nowhere to go there. The Next.js export is a full app with server routes and a Postgres database, which Netlify builds through its Next.js adapter. Choose by whether the site needs to keep taking bookings and messages.

Updated · By the Anticode team

Which export to take

The two routes to deploy AI website to Netlify
HTML exportNext.js export
Where to get itThe Code tab in Pro mode, HTML buttonThe Next.js download, or a GitHub push from the project's Settings
What Netlify doesServes the files as they areInstalls, builds and runs the app
FormsDon't work without changesWork, through the app's own route handlers
Needs a databaseNoYes, Postgres
Good forA brochure page, a portfolio, an archive copyA site that keeps taking bookings, messages and sign-ups

Route one: drop the HTML export

Netlify's deploy documentation describes drag and drop at Netlify Drop or at the bottom of your team's Projects page. It expects a folder, so prepare one first:

  1. Download the page. A one-page site arrives as a single file named after the project, such as harbour-bakery.html; a site with separate pages arrives as <name>-site.zip.
  2. For a single file, make a folder and put the file in it renamed to index.html, so it loads at the site's root address.
  3. For a zip, unzip it. It already holds an index.html at the top and a folder with its own index.html for each page, linked with relative paths.
  4. Drag the folder onto the drop zone. Netlify publishes it and gives you an address.
  5. To update later, export again and drop the new folder onto the drop zone on that site's Deploys page.

The page keeps its design exactly: the design system's font from Google Fonts, the single stylesheet, and photos from Anticode's curated library loading from images.unsplash.com. It also keeps its own Content-Security-Policy meta tag, which refuses every script, so nothing you add by accident will run.

What breaks on a static host

  • Forms. The booking, contact and newsletter forms post to /api/bookings, /api/contact and /api/subscribe. Those paths exist on Anticode's servers, not in your folder, so submissions fail. Netlify has its own form handling, but its form set-up guide requires a netlify or data-netlify="true" attribute on the form and form detection turned on; that's a hand edit to the downloaded file, outside Anticode.
  • Booking days. The calendar shows the days it had when you downloaded, not the coming days.
  • Site files. robots.txt, sitemap.xml, llms.txt, the Privacy and Terms pages, CMS pages and the security report are generated by Anticode and aren't in the download.

Route two: build the Next.js export

The Next.js export's README says any Node host works, and Netlify is one. According to Netlify's Next.js overview, its OpenNext adapter is applied automatically: route handlers run in serverless functions and middleware runs as an edge function, with no configuration from you. In practice:

  1. Push the project to GitHub from Anticode, then create a Netlify site from that repository.
  2. Set the build command to npm run db:deploy && npm run build. The README gives this command for Vercel only; using it on Netlify is general advice that keeps the same order, so migrations, which also create the row-level security policies, run before the build.
  3. Add the variables from .env.example: DATABASE_URL, APP_URL (the live address), ENCRYPTION_KEY, and RESEND_API_KEY, EMAIL_FROM and NOTIFY_EMAIL for email.
  4. Deploy, then run npm run db:seed once from your own machine against the production database to create the owner, and sign in at /admin/login to set up two-factor sign-in.

Two details are specific to hosts other than Vercel. The app reads the visitor's address from x-forwarded-for for its rate limits; if your host doesn't set that header, set TRUST_PROXY=0. And Netlify notes that headers and redirects are evaluated after middleware, which differs from standalone Next.js; the export sets its Content-Security-Policy in middleware itself, so check the response headers on a live page once.

Limits

  • Anticode doesn't deploy to Netlify for you and never holds Netlify credentials.
  • One-way copies. Changes made on Netlify, or in the repository, don't return to the Anticode project.
  • Hosted extras stay on Anticode: connectors, analytics, backups and the visual editor.
  • App builds export as one HTML document with their JavaScript; their forms rely on Anticode's form pipeline, so they won't reach you from a static host either.

Troubleshooting

The dropped site shows a file list or a 404 at the root
The file wasn't named index.html, or you dropped the zip without unzipping it.
Forms return an error page
Expected with the HTML export. Use the Next.js export, or replace the form with an email link.
The Next.js build fails on migrations
DATABASE_URL isn't set for the build, or the database blocks outside connections.
Forms say the request didn't come from this site
APP_URL doesn't match the address visitors use.

Related: the HTML export in detail, hosting the HTML export on Cloudflare Pages, and deploying the Next.js export to Vercel.

Questions people ask

Can I just drop the .html file onto Netlify?

Put it in a folder as index.html first. Netlify's drag and drop expects a folder, and the root address looks for index.html.

Will my Anticode contact form work on Netlify?

Not from the HTML export as downloaded. The Next.js export brings its own server routes, so its forms work wherever it's built.

Can I keep my anticode.dev address as well?

Yes. The exports are copies; the site published on Anticode stays live until you unpublish it.

Sources

  1. Netlify Docs: Create deploys, checked
  2. Netlify Docs: Forms setup, checked
  3. Netlify Docs: Next.js on Netlify, checked