Front-end and static sites
How to deploy a Vue app and host it online
In short
You can deploy a Vue app without renting a server: once it is built it is just a set of static files, so what you need is a host that builds the project and serves the result. Upload your source code to Netrun as an archive or import it from GitHub, and the platform reads package.json, installs the dependencies, runs the build and gives you a public HTTPS link. You do not need to include node_modules or the dist folder, that work happens on our side. Routes like /about in history mode work straight away, with no web server config to write.
The usual path looks like this. You run the build command, upload the resulting folder to a host, then configure the web server so that every URL returns index.html, because without that rule a refresh on /about gives a 404. After that you still have to sort out a certificate for HTTPS. The question of where to deploy a Vue app is rarely about the framework itself. It is about those three or four steps around it, and each one is easy to get wrong.
Netrun takes that part away: you upload the source code, the platform reads package.json, installs the dependencies, builds the project and serves it at a public link with a secure connection. Below is the path from a folder of code to a working address, plus the thing to know about VITE_ variables, which is how people accidentally publish their own API keys.
Check that the project builds on your machine#
The project root needs a package.json with a build script, which for Vue 3 with Vite is usually npm run build. Run it once locally: if the build fails on your machine it will fail on ours too, for exactly the same reason. Vue CLI projects and Vue 2 projects work the same way, all that matters is a build script that works.
Leave node_modules and the built output out of the archive#
We install the dependencies and run the build ourselves, so node_modules and dist only get in the way: they are heavy and they carry paths from your computer. Upload the source code, the same set of files you keep in your repository. If you import the project from GitHub there is nothing to clean up at all.
Keep real keys out of VITE_ variables#
Anything starting with VITE_ is baked into the built files at build time, which means those values ship to the browser and are visible to any visitor in the page source. An API base URL, a site name or a maps key are fine there. A database token, a payment provider key or a paid API secret are not. Real secrets belong on a backend that only returns the result.
Leave your router setup alone#
With the router in history mode your URLs look ordinary, like /about or /projects/1, and on a direct visit or a refresh the server has to return the same index.html. On a plain host you write a rewrite rule for that, and without it you get a 404 instead of the page. On Netrun this already works: open nested URLs, hit refresh, and there is no need to fall back to hash-based routing.
Decide where the backend lives#
A Vue app runs in the browser, so it cannot keep secrets or talk to a database directly, and that job belongs to a backend. You can publish it on Netrun as a separate project and call it at its own link, or keep everything in one project with your own docker-compose file, which supports up to five connected services, for example the frontend, the backend and a database. The backend address is not a secret, so it is a good fit for a VITE_ variable.
Upload the code and take the link#
Pack the folder into an archive or import a repository from GitHub, including a private one. Netrun reads package.json, installs the dependencies, builds the project and starts serving it at a public HTTPS address. Build progress and logs are visible in your dashboard in real time, so an error shows up immediately instead of as a blank white page.
The end result is a Vue app at an ordinary link: no rented server, no hand written rules for nested URLs, no certificate to renew yourself. On the free plan the site sleeps when nobody uses it for a while and wakes up when someone opens the link, so only the first visit after a pause is slower than usual. The Pro plan has no idle downtime and lets you attach your own domain. Current plans and limits are shown in your dashboard. Try Netrun.
Common questions
Do I have to build the project myself and upload the dist folder?
No, the source code is enough. Netrun installs the dependencies and runs the build script from package.json, then serves the output at your link. Uploading a folder you built yourself only makes updates harder, because every new version would have to be built by hand first.
Why does refreshing the page on /about return a 404?
That is how a plain host behaves: it looks for a file at that path and finds nothing, because Vue draws every page itself out of index.html. The fix is a rule that returns index.html for any URL. On Netrun that is already in place, so there is nothing to configure.
Can I put an API key in a VITE_ variable?
Not if it is a real secret. Values of VITE_ variables are compiled into the built files and any visitor can read them in the page source. Keys that unlock money or private data belong on a backend, and the app should call that backend instead of holding the key.
How do I connect a backend to a Vue app?
A backend is a separate program, so on Netrun you publish it either as its own project with its own link, or as a neighbouring service in your docker-compose file. In the app itself, keep the backend address in an environment variable so that local and published builds differ by a value rather than by code.
How is deploying a Vue project different from uploading a finished site?
A finished site is served as is, while a Vue project has to be built first: sources and components are turned into files a browser can run. Netrun does that step for you, so from the outside there is only one difference: you upload code rather than build output.
Will an older Vue 2 or Vue CLI project work?
Yes. The platform looks at package.json and the build script rather than the framework version, so Vue 2 and Vue CLI projects are published the same way. The only requirement is that the build finishes without errors, so fix a failing build locally before uploading the code.
How do I put a website online?
Upload your site code as a ZIP archive or from GitHub — Netrun builds it and gives you a working link with HTTPS. A static site (HTML, CSS, JS), a React app or a Python site all work. There is no domain to buy and no server or certificates to set up.
How do I update the code of a project that is already published?
Open the project and upload a new version or update it from GitHub. The link stays the same, and your data is kept as long as it lives in persistent storage — the /data folder or a volume from your compose file.
Do I need git if I have never used it?
No. You can simply upload an archive with your code — neither git nor a terminal is needed. And if GitHub is more convenient, you can import the project from there, including a private repository.
Can I connect my own domain?
Yes, on the Pro plan, and not just one: you can connect as many of your own domains to a website as you need. Open the “Domains” tab on the project page, enter the domain you bought from a registrar, and add the DNS record shown in the hint — every next domain is added the same way. Once the domains are ready, press “Check”: Netrun checks them all at once and issues a separate HTTPS certificate for each, so a hiccup with one domain does not hold up the others. The site opens at any of your addresses, and the Netrun link stays as a backup. If you connect a whole domain (for example myshop.com), you can add one more record so the site also opens with www. This is for websites — a bot or a background script does not need a domain.