Chưa có bản tiếng Việt nên hiển thị bằng tiếng Anh.

How to deploy a Vue app for free, from create-vue or Vue CLI

Quick answer

To deploy a Vue app for free, run npm run build and drop the dist folder on Convika's upload box. The box puts the JavaScript, CSS, and images inside one page and gives you a preview link in seconds, with no account. Switch Vue Router to createWebHashHistory, sign up free with no credit card, and publish the app at a lasting link. A build split into script chunks goes up on the dashboard's upload screen as a site at its own address, with createWebHistory and lazy views as they are.

Deploy my Vue app for free

Free plan: no credit card, 5 published pages, 10,000 page views a month.

On this page

To deploy a Vue app for free, build it and drop the dist folder on the box above. A project from npm create vue@latest and one from Vue CLI both build into dist. The box reads the folder in your browser, puts the JavaScript, CSS, and images inside one page, and gives you a link in seconds. No Git, no account for the preview, and no credit card to publish.

What a Vue build is

.vue files are source code: no browser runs them as they are. npm run build compiles them into plain files: an index.html, the JavaScript, the CSS, and the images your components use. That folder is the app, and it is what you upload.

Your projectBuild commandFolder to drop
create-vue (npm create vue@latest, built with Vite)npm run builddist
Vue CLI (vue create)npm run builddist

Once the app is built, you can drop the whole project folder too. The box takes the index.html in dist and skips node_modules.

Deploy a Vue app in 5 steps

1. Set the router and build

If the app uses Vue Router, make the 2 changes in the Vue Router section below first. Then, in the project folder:

npm install
npm run build

2. Drop dist on the box

Drop the dist folder on the box at the top of this page, or zip it and drop the .zip. The box shows at once what it combined into one file: the JavaScript, the CSS, and the images. Click Get my preview link.

3. Check the preview

Open the link on your computer and your phone. It works for 3 minutes, with scripts and forms on, so every view of the app runs as it will live.

4. Keep the page

Click Keep this page — free, no card and sign up. The app moves into your account.

5. Publish it

Click Publish page. Under Who can open this page?, choose Public and click Next. The first time, Convika shows Publish free, and under it Publish without the Convika bar, which starts Pro with its free trial: 7 days free, then $12 a month, cancel any time before it ends. To publish on Free, click Publish free. The app is live at an address like yourpage.convika.page.

Vue Router: use the hash history

The app lives at one address, and Vue Router switches views inside it. With the hash history, each view gets an address like yourpage.convika.page/#/about, and a reload opens the app on any view.

The router that npm create vue@latest and Vue CLI write also loads the About view as a separate file, with () => import(...). The box puts the scripts of index.html inside the page, so import every view the usual way. In src/router/index.js:

import { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";
import AboutView from "../views/AboutView.vue";

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    { path: "/", name: "home", component: HomeView },
    { path: "/about", name: "about", component: AboutView },
  ],
});

export default router;

<RouterLink to="/about"> and router.push() stay exactly as you wrote them. When a script still loads others, the box names them as soon as you drop the folder, above Get my preview link.

Or keep the router as it is: upload the build as a site

The starter router, with createWebHistory() and the About view loaded by () => import(...), goes up unchanged as a site. Sign up free and drop dist on the dashboard's upload screen:

  • Its own address. The Site URL field offers a free address, such as yourapp.convika.page, and the app opens at / of it, so /assets/index-4f2a.js and the About view's own file load from their paths.
  • Views reload at their own address. A path the site doesn't have opens its index.html, so /about opens the app on the About view.
  • Sizes. Each .html file up to 4 MB, and all the files together up to 100 MB on Free and 5 GB on Pro.

Click Create my preview, check the private preview, and publish it as in step 5.

Base path: leave it as it is

The build writes its paths from the root, such as /assets/index-4f2a.js or /js/app.3b1c.js. The box reads a path that starts with / from the folder that holds index.html, so those files go into the page as they are. Keep base in vite.config.js and publicPath in vue.config.js at their defaults.

Images go into the page as they are

An image in index.html, in the CSS, or in a component goes into the page. The box finds image paths in the built script, such as "/assets/logo-3f2a.png" or "/logo.png", and puts the image from the folder in their place. In a create-vue app, <img src="./assets/logo.png">, <img src="@/assets/logo.png">, and a file in public/ all work with no setting.

Vue CLI joins the folder name to the image's path inside its script. Set vue.config.js so webpack writes images into the script itself, then build again:

module.exports = {
  chainWebpack: (config) => {
    config.module
      .rule("images")
      .set("parser", { dataUrlCondition: { maxSize: 100000000 } });
  },
};

The whole page, images included, fits in 4 MB. Large photos and video load from an https:// address and don't count toward it.

Change the code and run npm run build again. In Convika, open your live page's screen. Under Update from an HTML file, click Upload a new version and drop the new dist folder, or its .zip. Click Upload as a new version, open the preview, then click Publish v2 at the same link and confirm with Publish. Everyone with the link sees the new build.

What Free includes, and what Pro adds

FreePro
PriceNo credit card7 days free, then $12 a month
Apps live at once5100
Page views a month10,000100,000
Who can open itPublicPublic, Private link, or Only people with the password
Convika bar on the pageYesNo
Custom domains1Unlimited

Every app gets visitor stats in the dashboard: who came, from where, and what they clicked.

Frequently asked questions

How do I deploy a Vue app for free?

Run npm run build and drop the dist folder on Convika's upload box. Click Get my preview link, then Keep this page — free, no card, and publish with Publish page, Public, Next, and Publish free. The Free plan needs no credit card.

Does Vue Router work on Convika?

Yes. In one page, use createWebHashHistory(): each view then has an address like /#/about, and a reload opens the app on any view. Import each view the usual way instead of with () => import(...), then build. Or upload the build as it is on the dashboard's upload screen: it becomes a site, and createWebHistory() with lazy views works there.

Do I need to change publicPath or base?

No. The box reads paths that start with / from the folder that holds index.html, so a build with the default base or publicPath goes in as it is.

Why is my deployed Vue app blank, or the About page empty?

The About view of the starter router loads from a separate file. Import it at the top of src/router/index.js, as in the example above, and build again, or drop dist on the dashboard's upload screen, where the build goes up as a site with that file at its own path. If the whole app is blank, build first and drop the dist folder.

Do I need Git or GitHub to deploy a Vue app?

No. The box takes the folder or a .zip straight from your computer.

Next step

How to password protect an HTML page or website

A JavaScript password sits in the page source. Free: StatiCrypt or .htaccess. Paid: Netlify Pro $20, Vercel $20 a project, Tiiny Host $18, or Convika Pro.

Related articles

More ways to send your page

Skipbox

Cheap & fast GitHub Actions runners, unlimited for $39 a month

Your own machine keeps Docker layers and package caches between jobs. Switch by changing one runs-on line.

Start a free Skipbox trial⁠

Share this article

Your Vue app, live at one link

Drop the dist folder. Convika hosts the app, counts its visitors, and keeps the link when you upload a new build.

Deploy my Vue app for free

Free plan: no credit card, 5 published pages, 10,000 page views a month.