Skip to content

Deploy to cPanel or VPS

This page teaches you how to deploy Finance App to cPanel, a VPS, or Plesk. You do not need any server experience.

By the end of this page, you will have:

  • A working production build of your site
  • The dist/ folder uploaded to your server
  • A live website accessible from your domain

cPanel, VPS, and Plesk are types of hosting accounts. They give you a folder on a server where you can place files.

For a static Astro site, you do not need Node.js running on the server. You only need to upload the final HTML, CSS, JavaScript, and image files that Astro produces .

This method is different from Cloudflare Pages, Vercel, or Netlify. Those platforms connect to GitHub and build your site automatically. With cPanel, VPS, or Plesk, you build the site on your own computer first, then upload the result.

Make sure you have:

  • Your Finance App project folder on your computer
  • Node.js installed (see the Installation page)
  • Your cPanel, VPS, or Plesk login details
  • An FTP client like FileZilla (optional, but recommended)
  • A domain pointed to your hosting account

Open a terminal in your project folder and run:

npm run build

This creates a dist/ folder in your project. That folder contains the final site files .

Do not upload the dist folder itself. Upload only what is inside it.

Before uploading, make sure the site field in astro.config.mjs matches your real domain .

site: 'https://yourdomain.com',

Without this, your sitemap and RSS feed will point to the wrong address.

Every server has a folder where public files are served. The name depends on your host:

Host Type Folder Name
cPanel public_html
Plesk httpdocs
VPS (Nginx) /var/www/yourdomain/html

Check your host’s documentation if you are unsure .

You can upload using one of these methods.

  1. Log in to cPanel
  2. Open File Manager
  3. Go to public_html
  4. Click Upload
  5. Upload all files from inside your local dist/ folder
  6. If you uploaded a ZIP file, extract it inside public_html
  1. Log in to Plesk
  2. Go to Websites & Domains → your domain → File Manager
  3. Open httpdocs
  4. Upload all files from inside your local dist/ folder
  1. Open FileZilla
  2. Connect using your host, username, and password
  3. On the right side, navigate to public_html or httpdocs
  4. On the left side, navigate to your local dist/ folder
  5. Select all files inside dist/
  6. Drag them to the server folder

Important: Do not upload the dist folder itself. Upload its contents. If you upload the folder, your homepage will be at /dist/ instead of /.

Step 5 — Add the .htaccess File (cPanel Only)

Section titled “Step 5 — Add the .htaccess File (cPanel Only)”

If your site uses Astro’s default routing, you need a small file to handle page navigation.

  1. Create a file named .htaccess in your local dist/ folder before uploading
  2. Add this content:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
  1. Upload this file along with the rest of your files

This makes sure that a URL like /about/ correctly loads the about/index.html file.

For a custom 404 page, add this line too:

ErrorDocument 404 /404.html
  1. Open your browser
  2. Go to your domain
  3. Check that:
    • The homepage loads
    • Links work
    • Images appear
    • The contact form works

Every time you change content:

  1. Edit your files locally
  2. Run npm run build
  3. Upload the new dist/ contents again
  4. Delete old files first if you removed any pages. Uploading over old files does not remove deleted ones

If you use FTP, you can use the rsync command instead to only upload changed files:

rsync -av --delete dist/ user@yourdomain.com:/path/to/public_html/

The --delete flag removes files on the server that no longer exist locally .

You do not need Node.js on your server for a static Astro site. The files in dist/ are plain HTML, CSS, and JavaScript. Any web server can serve them .

You only need Node.js on the server if you are using Astro’s SSR (server-side rendering) mode with the Node adapter. That is a more advanced setup and not required for Finance App.

Problem Solution
Homepage shows a directory listing You uploaded the dist folder itself. Upload its contents instead.
404 error on sub-pages Add the .htaccess file (cPanel) or check your server’s routing rules
CSS or images not loading Check that file paths are correct. If using a subfolder, set base in astro.config.mjs.
Old pages still visible Delete old files on the server, or use rsync --delete
Site shows “403 Forbidden” Check file permissions. Files should be 644, folders 755 .

After deploying, you can set up your custom domain, add SSL, or continue using other deployment methods.