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.
Which export to take
| HTML export | Next.js export | |
|---|---|---|
| Where to get it | The Code tab in Pro mode, HTML button | The Next.js download, or a GitHub push from the project's Settings |
| What Netlify does | Serves the files as they are | Installs, builds and runs the app |
| Forms | Don't work without changes | Work, through the app's own route handlers |
| Needs a database | No | Yes, Postgres |
| Good for | A brochure page, a portfolio, an archive copy | A 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:
- 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. - 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. - For a zip, unzip it. It already holds an
index.htmlat the top and a folder with its ownindex.htmlfor each page, linked with relative paths. - Drag the folder onto the drop zone. Netlify publishes it and gives you an address.
- 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/contactand/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 anetlifyordata-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:
- Push the project to GitHub from Anticode, then create a Netlify site from that repository.
- 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. - Add the variables from
.env.example:DATABASE_URL,APP_URL(the live address),ENCRYPTION_KEY, andRESEND_API_KEY,EMAIL_FROMandNOTIFY_EMAILfor email. - Deploy, then run
npm run db:seedonce from your own machine against the production database to create the owner, and sign in at/admin/loginto 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_URLisn't set for the build, or the database blocks outside connections.- Forms say the request didn't come from this site
APP_URLdoesn'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
- Netlify Docs: Create deploys, checked
- Netlify Docs: Forms setup, checked
- Netlify Docs: Next.js on Netlify, checked