---
title: "Deploying to Other Hosting Providers"
description: "A complete, beginner-friendly guide to deploying your Nuxas project to Cloudflare Pages, Vercel, AWS Amplify, cPanel shared hosting, and a VPS. Learn the difference between SSG and SSR builds, and the exact build commands, presets, and platform-specific configurations for each."
canonical_url: "https://nuxas.pages.dev/docs/18-other-hosts"
---

> Index of every page on this site: [llms.txt](https://nuxas.pages.dev/llms.txt)

## Deploying to Other Hosting Providers

In the previous chapter, we deployed to Netlify. Netlify is the recommended choice for Nuxas, especially if you are using Decap CMS, because it provides Identity and Git Gateway out of the box.

But Netlify is not the only option. Nuxt is platform-agnostic thanks to Nitro, its server engine. You can deploy to almost any platform with minimal configuration: Node.js servers, static hosting, serverless functions, or edge networks.

This chapter covers the most popular alternatives: Cloudflare Pages, Vercel, AWS Amplify, cPanel shared hosting, and a VPS. For each one, we explain what you need to do and what to watch out for.

### Part 1 — Build Output: SSG vs SSR, Revisited

Before we dive into each platform, let us clarify the single most important concept in deployment: **build output**. Every deployment starts with a build command, and the output of that build is what you deploy. For Nuxas, there are two possible outputs, and they are not interchangeable.

**SSG (Static Site Generation)** — produced by `npm run generate`.

- **Output folder:** `.output/public/`
- **What it contains:** plain HTML, CSS, and JavaScript files. No server.
- **How it is served:** directly from a CDN or static file host.
- **Trade-offs:** fastest possible response time and cheapest to host, but no server-side rendering at request time, no API routes, no runtime environment variables.
- **Use when:** the site is frontend-only, content is known at build time, and there is no server logic.

**SSR (Server-Side Rendering)** — produced by `npm run build`.

- **Output folder:** `.output/` (contains a portable Node.js server).
- **What it contains:** a Node.js server that renders pages on demand.
- **How it is served:** on a Node.js runtime (long-running server, serverless function, or edge function).
- **Trade-offs:** dynamic content, API routes, auth, and runtime environment variables work, but the site needs a Node.js runtime and may cost more and have cold starts.
- **Use when:** the site has API routes, server middleware, authentication, or per-request logic.

**The rule of thumb for Nuxas:** if the site is frontend-only, use **SSG** (`npm run generate` → `.output/public`). If the site needs server logic, use **SSR** (`npm run build` → `.output/`). Do not mix the two: a `generate` build cannot produce a Node.js server, and a `build` build cannot produce a static folder.

Most of the platforms below support both modes. Cloudflare Pages, Vercel, and AWS Amplify detect Nuxt automatically and default to **SSR**. For a frontend-only Nuxas site, you must explicitly override the build command to `npm run generate` and the output directory to `.output/public`.

**Quick reference for every platform in this chapter:**

<table>
<thead>
  <tr>
    <th>
      Mode
    </th>
    
    <th>
      Build command
    </th>
    
    <th>
      Output directory
    </th>
    
    <th>
      Needs a Node runtime?
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        SSG
      </strong>
      
       (frontend-only Nuxas)
    </td>
    
    <td>
      <code>
        npm run generate
      </code>
    </td>
    
    <td>
      <code>
        .output/public
      </code>
    </td>
    
    <td>
      No
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        SSR
      </strong>
      
       (sites with API routes)
    </td>
    
    <td>
      <code>
        npm run build
      </code>
    </td>
    
    <td>
      <code>
        dist
      </code>
      
       / <code>
        .output
      </code>
    </td>
    
    <td>
      Yes
    </td>
  </tr>
</tbody>
</table>

### Option 1 — Cloudflare Pages

Cloudflare Pages is an excellent choice for performance and cost. It has unlimited bandwidth on the free tier and a global edge network that delivers the fastest TTFB.

**Why choose Cloudflare Pages:**

- Unlimited bandwidth, even on the free tier.
- Excellent global performance.
- Very cost-effective at scale.
- Supports both static hosting (SSG) and edge functions (SSR).

**Important Cloudflare-specific caveat:** Cloudflare Pages cannot serve a folder whose name starts with a dot (`.output`). If you deploy SSG output, the publish directory must be `.output/public` (Cloudflare accepts this path for reading), but if your build process produces `.output` as the root, Cloudflare will not read it. The safest configuration for SSG on Cloudflare is to use the `generate` command, which produces `.output/public` directly, and set the build output directory to `.output/public`.

**How to deploy SSG (recommended for frontend-only Nuxas):**

1. Push your code to GitHub (you already did this in Chapter 16).
2. Log in to the Cloudflare dashboard and go to **Workers & Pages**.
3. Click **Create application**, then **Pages**, then **Connect to Git**.
4. Select your GitHub repository.
5. Configure the build settings:

  - **Framework preset:** Nuxt
  - **Build command:** `npm run generate`
  - **Build output directory:** `.output/public`
6. Click **Save and Deploy**.

**How to deploy SSR (only if you need server logic):**

1. Follow the same steps as above, but set:

  - **Build command:** `npm run build`
  - **Build output directory:** `dist`
2. Ensure your `nuxt.config.ts` includes the Cloudflare Nitro preset if you are uploading via wrangler rather than Git integration.

Cloudflare Pages will build and deploy your site automatically. Every push to your `main` branch triggers a new deployment.

**Important note for Nuxas:** If you use `@nuxt/image` with external domains (like Unsplash), you may need to configure Cloudflare's Image CDN or disable the module for Cloudflare deployments. The `@nuxt/image` module is designed for Node.js environments and may not work out of the box on Cloudflare Workers. For most Nuxas users, this is not an issue because the images are already optimized URLs from Unsplash.

**Decap CMS on Cloudflare:** Decap CMS's cloud mode (Git Gateway) relies on Netlify's services. If you deploy to Cloudflare, you cannot use Git Gateway. You would need to use the GitHub backend for Decap CMS instead, which requires your editors to have GitHub accounts and a GitHub OAuth app. This is more complex than the Netlify setup. If you are using Decap CMS, **Netlify remains the recommended choice**.

### Option 2 — Vercel

Vercel is the company behind Next.js, but it also has excellent support for Nuxt. It offers zero-config deployment and a great developer experience.

**Why choose Vercel:**

- Zero configuration for Nuxt (auto-detects).
- Excellent preview deployments for pull requests.
- Built-in analytics and speed insights.
- Supports both SSG (static output) and SSR (serverless functions).

**How to deploy SSG (recommended for frontend-only Nuxas):**

1. Push your code to GitHub.
2. Log in to [https://vercel.com](https://vercel.com).
3. Click **Add New**, then **Project**.
4. Import your GitHub repository.
5. Vercel will auto-detect Nuxt and suggest **SSR** defaults (`npm run build` + `.vercel/output`). **Override them** to:

  - **Build command:** `npm run generate`
  - **Output directory:** `.output/public`
6. Click **Deploy**.

**How to deploy SSR (only if you need server logic):**

1. Follow the same steps, but leave Vercel's auto-detected defaults:

  - **Build command:** `npm run build`
  - **Output directory:** `.vercel/output`

Vercel will build and deploy your site. Every push to your repository triggers a new deployment.

**Important note for Nuxas:** Vercel's free tier has limited bandwidth and build minutes. For a small SaaS site, this is usually fine. If your site grows, you may need a paid plan.

**Decap CMS on Vercel:** Same as Cloudflare. Git Gateway is a Netlify service. You would need to use the GitHub backend for Decap CMS, which requires more setup.

### Option 3 — AWS Amplify

AWS Amplify Hosting provides a Git-based workflow for deploying full-stack serverless web applications. It supports Nuxt with both SSG and SSR.

**Why choose AWS Amplify:**

- Integrates with the AWS ecosystem.
- Supports both SSG and SSR for Nuxt.
- Global CDN via CloudFront.

**How to deploy SSG (recommended for frontend-only Nuxas):**

1. Push your code to GitHub (or Bitbucket, GitLab, or AWS CodeCommit).
2. Log in to the AWS Management Console and go to **AWS Amplify**.
3. Click **New app**, then **Host web app**.
4. Connect your Git provider and select your repository.
5. Amplify will detect Nuxt and suggest **SSR** defaults. **Override them** to:

  - **Build command:** `npm run generate`
  - **Output directory:** `.output/public`
6. Click **Save and deploy**.

**How to deploy SSR (only if you need server logic):**

1. Follow the same steps, but keep Amplify's auto-detected defaults:

  - **Build command:** `npm run build`
  - **Output directory:** `.amplify-hosting`

Amplify will build and deploy your site. Every push triggers a new deployment.

**Important note for Nuxas:** AWS Amplify has a more complex pricing model than Netlify or Vercel. It is free for the first 12 months under the AWS Free Tier, but after that, you pay for build minutes, storage, and data transfer. For a small site, the cost is minimal, but it is worth understanding before you commit.

**Decap CMS on AWS Amplify:** Same limitation. Git Gateway is Netlify-only. You would need the GitHub backend for Decap CMS.

### Option 4 — cPanel Shared Hosting

If you already have a shared hosting account with cPanel (for example, from HostGator, Bluehost, or Namecheap), you can deploy Nuxas there. The process is more manual than the platforms above, but it works.

**Important note:** Shared hosting usually runs on Apache with PHP, not Node.js. To run Nuxt there, your host must provide **Node.js Selector** in cPanel. Many modern shared hosts do, but some do not. Check with your host before proceeding.

**How to deploy SSG (recommended for frontend-only Nuxas):**

SSG is by far the easiest mode on cPanel because it needs no Node.js runtime at all. You only need to upload static files.

1. Build the project on your local machine:```cmd
npm run generate
```

<br />

This produces a `.output/public/` folder.
2. In cPanel, open **File Manager** and navigate to `public_html`.
3. Upload the **contents** of `.output/public/` (not the folder itself) into `public_html`.
4. Create or edit `.htaccess` in `public_html` to add SPA fallback so deep routes resolve correctly:```apache
<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.html$ - [L]
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.html [L]
</IfModule>
```
5. Visit your domain. The site is live, no Node.js required.

**How to deploy SSR (only if you need server logic and Node.js Selector is available):**

1. Build the project locally:```cmd
npm run build
```

<br />

This produces a `.output/` folder.
2. In cPanel, open **File Manager** and navigate to a folder **outside** `public_html` (for example, `/home/youruser/nuxas/`). Upload:
  - The entire `.output/` folder.
  - `package.json` and `package-lock.json`.<br />

Do not upload `node_modules/` — cPanel will install dependencies for you.
3. Create a startup file called `server.cjs` in the same folder:```js
const { createApp } = require('@nuxt/cli')
const { listen } = require('listhen')

async function main() {
  const { createNuxt } = await import('./.output/server/index.mjs')
  const nuxt = await createNuxt()
  const app = createApp(nuxt)
  await listen(app, { port: process.env.PORT || 3000 })
}

main()
```
4. In cPanel, open **Setup Node.js App** and click **Create Application**:
  - **Node.js version:** 20 or newer.
  - **Application root:** the folder you created (e.g., `nuxas`).
  - **Application URL:** your domain.
  - **Application startup file:** `server.cjs`.
  - **Application mode:** Production.
5. Click **Create**. cPanel will install dependencies and start the app.

**Limitations on shared hosting (SSR only):**

- SSR may be slow due to limited resources.
- You cannot use PM2 for process management (cPanel handles it).
- Environment variables are set in the Node.js Selector interface, not in `.env`.
- Decap CMS cloud mode is not possible on shared hosting. You would need to use the local mode and commit changes manually.

### Option 5 — VPS (Virtual Private Server)

A VPS gives you full control. You manage the server, install Node.js, configure Nginx, and set up SSL. This is the most flexible option, but also the most work.

**Why choose a VPS:**

- Full control over the environment.
- No vendor lock-in.
- Can host multiple sites on one server.
- Predictable monthly cost.

**How to deploy SSG (recommended for frontend-only Nuxas):**

SSG on a VPS is trivial: you only need a static web server. You can use Nginx to serve `.output/public/` directly. No Node.js, no PM2, no process manager.

1. **Provision a VPS** from a provider like DigitalOcean, Linode, Vultr, or Hetzner. Choose Ubuntu 22.04 or 24.04.
2. **Connect via SSH:**```cmd
ssh root@your-server-ip
```
3. **Install Nginx:**```bash
apt update && apt install nginx -y
```
4. **Build the project locally** and upload the **contents** of `.output/public/` to `/var/www/nuxas/` on the server (via SFTP or `scp`).
5. **Configure Nginx** to serve the static files. Create `/etc/nginx/sites-available/nuxas`:
```nginx
server {
  listen 80;
  server_name yourdomain.com;
  root /var/www/nuxas;
  index index.html;

  location / {
    try_files $uri $uri/ /index.html;
  }
}
```
6. **Enable the site and restart Nginx:**```bash
ln -s /etc/nginx/sites-available/nuxas /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx
```
7. **Set up SSL with Certbot:**```bash
snap install certbot --classic
certbot --nginx -d yourdomain.com
```

**How to deploy SSR (only if you need server logic):**

1. **Provision a VPS** and connect via SSH as above.
2. **Install Node.js, Nginx, and PM2:**```bash
apt update && apt install nginx -y
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs
npm install -g pm2
```
3. **Build the project locally** and upload the `.output/` folder and `package.json` to your server (via SFTP or Git).
4. **Create an ecosystem.config.cjs** file in your project folder on the server:
```js
module.exports = {
  apps: [
    {
      name: 'nuxas',
      port: '3000',
      exec_mode: 'cluster',
      instances: 'max',
      script: './.output/server/index.mjs',
      env: {
        NODE_ENV: 'production',
      },
    },
  ],
}
```
5. **Start the app with PM2:**```bash
pm2 start ecosystem.config.cjs
pm2 save
pm2 startup
```
6. **Configure Nginx** as a reverse proxy. Create `/etc/nginx/sites-available/nuxas`:
```nginx
server {
  listen 80;
  server_name yourdomain.com;

  location / {
    proxy_pass http://localhost:3000;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
  }
}
```
7. **Enable the site and restart Nginx:**```bash
ln -s /etc/nginx/sites-available/nuxas /etc/nginx/sites-enabled/
nginx -t
systemctl restart nginx
```
8. **Set up SSL with Certbot:**```bash
snap install certbot --classic
certbot --nginx -d yourdomain.com
```

**Decap CMS on VPS:** You can use the GitHub backend for Decap CMS, but you need to create a GitHub OAuth app and configure the callback URL to point to your server. This is more complex than the Netlify setup. Alternatively, you can use the local mode and commit changes manually.

### Summary: Which Host and Which Mode Should You Choose?

**Mode choice:**

- **Frontend-only Nuxas:** always use **SSG** (`npm run generate` → `.output/public`). It is faster, cheaper, and simpler on every platform.
- **Nuxas with API routes, auth, or per-request logic:** use **SSR** (`npm run build` → `dist` or `.output`).

**Platform choice:**

<table>
<thead>
  <tr>
    <th>
      Host
    </th>
    
    <th>
      SSG support
    </th>
    
    <th>
      SSR support
    </th>
    
    <th>
      Decap CMS
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Netlify
      </strong>
    </td>
    
    <td>
      ✅ <code>
        generate
      </code>
      
       + <code>
        .output/public
      </code>
    </td>
    
    <td>
      ✅ <code>
        build
      </code>
      
       + <code>
        dist
      </code>
    </td>
    
    <td>
      Git Gateway (easiest)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Cloudflare Pages
      </strong>
    </td>
    
    <td>
      ✅ <code>
        generate
      </code>
      
       + <code>
        .output/public
      </code>
    </td>
    
    <td>
      ✅ <code>
        build
      </code>
      
       + <code>
        dist
      </code>
    </td>
    
    <td>
      GitHub backend (more setup)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Vercel
      </strong>
    </td>
    
    <td>
      ✅ <code>
        generate
      </code>
      
       + <code>
        .output/public
      </code>
    </td>
    
    <td>
      ✅ <code>
        build
      </code>
      
       + <code>
        .vercel/output
      </code>
    </td>
    
    <td>
      GitHub backend (more setup)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        AWS Amplify
      </strong>
    </td>
    
    <td>
      ✅ <code>
        generate
      </code>
      
       + <code>
        .output/public
      </code>
    </td>
    
    <td>
      ✅ <code>
        build
      </code>
      
       + <code>
        .amplify-hosting
      </code>
    </td>
    
    <td>
      GitHub backend (more setup)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        cPanel
      </strong>
    </td>
    
    <td>
      ✅ upload <code>
        .output/public
      </code>
      
       contents
    </td>
    
    <td>
      ✅ Node.js Selector required
    </td>
    
    <td>
      Local mode only
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        VPS
      </strong>
    </td>
    
    <td>
      ✅ Nginx serves <code>
        .output/public
      </code>
    </td>
    
    <td>
      ✅ Node.js + PM2 + Nginx
    </td>
    
    <td>
      GitHub backend or local mode
    </td>
  </tr>
</tbody>
</table>

If you are using Decap CMS and want the simplest setup, **Netlify is the clear winner**. If you are not using Decap CMS, or if you are comfortable with a bit more setup, Cloudflare Pages and Vercel are excellent alternatives. For a frontend-only Nuxas site, **SSG on any of these platforms is the fastest and cheapest path**.

### What to Expect in the Next Chapter

In the next chapter, we will cover custom domains. You will learn how to connect your own domain to your hosting provider, configure DNS records, and set up SSL. This is the final step before your site is truly yours.

See you in the next chapter.

## Sitemap

See the full [sitemap](https://nuxas.pages.dev/sitemap.md) for all pages.
