How to publish a website you built with AI: hosting, domain and HTTPS

The site works on your screen. Now it needs to be on the internet, at your own address, and stay there while you keep changing it. This part is less glamorous than building, and it is where small mistakes cost the most: a domain in someone else's name, email that stops working, a secret key in public code. Here is how to do it properly, step by step.

What publishing a site consists of

  • The code, kept in a repository such as GitHub, in your own account.
  • Hosting: the service that serves your site to visitors.
  • A domain name, registered in your name at a domain registrar.
  • DNS records that point the domain at the hosting, and HTTPS so the site opens securely.

Where to host it

Good forWhat to know
The builder's own hosting (Lovable, Bolt, Replit and similar)Getting a prototype online in one clickConvenient, but the site stays tied to that platform and its plan.
Static site hosting (Cloudflare Pages, Netlify, Vercel, GitHub Pages)Websites: pages, a blog, a contact formOften free or low-cost for a small site, fast, and publishes from your repository.
App platforms (Vercel, Render, Railway and similar, with a database such as Supabase)Web apps with accounts and dataCosts grow with use; keep an eye on the database and its backups.

As of October 2026. Features and free tiers change, so check each service's current terms.

Step by step

  1. Put the code in your own GitHub

    Most AI builders can push to GitHub; a coding assistant works in a repository from the start. Your account, not a helper's.

  2. Connect the hosting to the repository

    Then every change you push is published automatically, and you can go back to any earlier version.

  3. Keep secrets out of the code

    API keys and database passwords go in the hosting's environment variables, never in files that reach the browser or GitHub.

  4. Register the domain in your own name

    At a registrar you choose, with your email as the owner. Turn on auto-renewal so it never lapses.

  5. Add the domain to the hosting and set DNS

    The hosting tells you which records to add at the registrar. Change only those. Leave the mail records (MX) as they are, or your email stops.

  6. Check HTTPS, www and the redirect

    Once DNS updates, the certificate usually appears by itself. Make sure both yourdomain.com and www.yourdomain.com open, and one redirects to the other.

  7. Tell Google

    Add the site to Google Search Console, submit the sitemap and request indexing for the main pages.

Publishing changes without breaking things

  • Use preview deployments: most hosts give each change its own test address before it goes live.
  • Change one thing at a time, check it in the preview, then publish.
  • Know how to roll back to the previous version in one click, before you need it.

Mistakes that cost the most

  • The domain registered by a freelancer or a friend, in their name.
  • DNS records replaced wholesale, taking the email records with them.
  • An API key in the site's code, visible to anyone who opens the browser tools.
  • A new site launched over an old one without redirects for the old addresses.
  • The only copy of the code inside a builder's account.

When it is worth getting help

If you want to keep building and publishing changes yourself, but with someone who has done it many times beside you, our one-on-one AI training covers exactly this: your own project, your own accounts, Claude Code, and a safe way to publish changes.

Frequently asked questions

Can I just use the builder's publish button?

For a prototype, yes. For a business site you plan to keep, it is worth having the code in your GitHub and the domain in your name, so you can move the site whenever you want.

How long does it take for the domain to work?

Often minutes, sometimes a few hours while DNS changes spread. HTTPS usually follows on its own.

Will connecting the domain break my email?

Not if you add only the records the hosting asks for and leave the mail (MX) records alone.

Is free hosting good enough for a business?

For many small websites, yes: the free tiers of major hosts are fast and reliable. Read their limits, and move to a paid tier when the site needs it.

Where do I keep API keys?

In the hosting's environment variables or secrets settings, on the server side. Never in code that runs in the browser.