How to deploy a website built with GitHub Copilot
Built your site with GitHub Copilot or its coding agent? Get the code onto a host, fix what differs in production, and go live on your own domain.
The short version
GitHub Copilot writes code with you, in your editor or as an agent on GitHub, but it doesn't host your website. Whichever way you used it, you end up with an ordinary project: a React or Next.js app, a Python or Node server, sometimes one HTML page. To put it in production, get the code onto GitHub or into a ZIP, fix the few things that behave differently on a server, and deploy it to a host.
| Option | Good for | What to know |
|---|---|---|
| ProHostiva | Front ends and servers alike, with HTTPS and your domain in one place | A paid plan. We check your project for free first, and can publish it and connect your domain for you. |
| Front-end platforms (Vercel, Netlify, Cloudflare Pages…) | Static sites, React or Vue apps, Next.js | Free tiers (read their terms for commercial use). Long-running servers, Python and PHP are limited or not offered. |
| App platforms or your own server (Render, Railway, Fly.io, a VPS…) | Servers, background jobs, full control | More to set up yourself. On your own server, updates, security, backups and HTTPS are yours to look after. |
Not sure your project is ready?
1. Find where your code is
| You used | Where the code is | What to do |
|---|---|---|
| Copilot in your editor (chat, edits or agent mode) | In a folder on your computer | Commit and push it to GitHub, or zip the folder. See Deploying from a ZIP. |
| Copilot coding agent (on GitHub) | In your GitHub repository. The agent works on a branch and opens a pull request with its changes. | Review the pull request and merge what you want to keep. The host deploys a branch, usually main, so work that isn't merged isn't included. |
The agent's environment isn't your hosting
2. Have Copilot make it production-ready
Give Copilot a task like this one, in agent mode in your editor, or as an issue you assign to the coding agent (then review its pull request before merging):
Prepare this project for production hosting. The host builds from the
repository root, runs one container, sets the PORT environment variable
and provides secrets as environment variables. Please:
- make the app listen on PORT
- move every secret and API key into environment variables, and list
their names (without values) in .env.example
- make sure .env is in .gitignore
- read the database URL from an environment variable instead of
pointing at localhost
- make sure there is a production build and a start command
- make the home page / return a normal page without a login
Don't deploy anything. Change the code and list what you changed.Keep it that way with custom instructions
Copilot follows repository custom instructions in .github/copilot-instructions.md, and the coding agent also reads AGENTS.md. Add a few lines to one of them so later changes don't undo the work:
## Deployment
- Production builds from the repository root and runs as one container.
- The app must listen on the PORT environment variable.
- Secrets and URLs come from environment variables; never commit .env.
- Add every new variable name to .env.example.
- The home page / must answer without a login..github folder and AGENTS.md are never served on ProHostiva, even on a plain HTML site where every other file in the folder is published.Project layouts to watch for
- Separate front-end and back-end folders (such as
frontend/andbackend/). ProHostiva builds the top level of a repository or ZIP, so put each part in its own repository and deploy them as two websites, or ask Copilot to make the backend serve the built front end so it's one app. - A Docker Compose file with a database next to the app (
docker-compose.yml). Multi-container setups aren't supported: deploy the app on its own and use a hosted database such as Supabase or Neon. - A Dockerfile at the top level is always used when it's there. If it was written for development, ask Copilot to make it production-ready or remove it, and we'll build the project ourselves.
3. Deploy it with ProHostiva
Check it (free)
Paste your repository's address into Check my project, or upload the ZIP. Anything the report flags can usually be handed straight to Copilot as a task or an issue.
Start a new website
In your dashboard, click Host a website, then choose GitHub repository and connect GitHub, or upload the ZIP. Pick the branch your merged work is on. See Deploying from GitHub.
Check what we detected
We show the framework, the runtime version and the build and start commands. Change a command only if you know it's different.
Add environment variables
Everything in your
.env.examplegoes under Developer settings → Environment variables, with production values. Tick Secret for anything private.Publish
Name the website, choose its address and click Publish website. We build it in an isolated container, check that the home page answers, and put it online at
yourname.prohostiva.com.Connect your domain
Under Domains, add your domain, create the two DNS records we show and click Verify DNS. HTTPS is set up for you. See Connecting your own domain.
Updating the site later
Keep working with Copilot as before. When the changes are on your deployed branch (merged from the agent's pull request, or pushed from your computer), click Publish latest version on the website's page. Nothing goes live until you click, and if a new version fails to build or start, the current one stays online.
Rather we did it?
Before you send people to it
- Rotate any key that was ever committed. Deleting it from the code isn't enough if it's in the Git history; create a new one at the service and set it as an environment variable.
- Allow your domain where your code or its services expect known addresses: Django's
ALLOWED_HOSTS, an API's CORS origins, and sign-in redirect URLs at Google, GitHub, Supabase or Auth0. - Switch services to production: Stripe live keys and a webhook pointing at your domain, a production database rather than a test one, real email settings.
- Run your database migrations. They're never run automatically on deploy.
Common problems
- The live site doesn't have Copilot's latest changes: the agent's pull request isn't merged into your deployed branch yet, or the website deploys a different branch. Merge it, then click Publish latest version.
- It works on my computer but the build fails: often a file that was never committed, a missing lockfile, or a package the agent's setup steps installed but your project doesn't list. Add it to
package.jsonorrequirements.txtand deploy again. - Health check failed: the app listens on a fixed port instead of
PORT, or the home page redirects to a login. See Troubleshooting. - "We couldn't find a website or app here": the project is in a subfolder. See the layouts above.
- Database connection errors: the database URL still points at
localhost. Use your hosted database's URL in an environment variable. - A blank page (React, Vue, Svelte): a missing
VITE_variable. Add it and deploy again.