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
What This Method Is For
Section titled “What This Method Is For”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.
Before You Start
Section titled “Before You Start”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
Step 1 — Build the Site Locally
Section titled “Step 1 — Build the Site Locally”Open a terminal in your project folder and run:
npm run buildThis 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.
Step 2 — Check the site Field
Section titled “Step 2 — Check the site Field”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.
Step 3 — Find Your Public Folder
Section titled “Step 3 — Find Your Public Folder”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 .
Step 4 — Upload the Files
Section titled “Step 4 — Upload the Files”You can upload using one of these methods.
Option A: cPanel File Manager
Section titled “Option A: cPanel File Manager”- Log in to cPanel
- Open File Manager
- Go to
public_html - Click Upload
- Upload all files from inside your local
dist/folder - If you uploaded a ZIP file, extract it inside
public_html
Option B: Plesk File Manager
Section titled “Option B: Plesk File Manager”- Log in to Plesk
- Go to Websites & Domains → your domain → File Manager
- Open
httpdocs - Upload all files from inside your local
dist/folder
Option C: FTP Client (FileZilla)
Section titled “Option C: FTP Client (FileZilla)”- Open FileZilla
- Connect using your host, username, and password
- On the right side, navigate to
public_htmlorhttpdocs - On the left side, navigate to your local
dist/folder - Select all files inside
dist/ - Drag them to the server folder
Important: Do not upload the
distfolder 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.
- Create a file named
.htaccessin your localdist/folder before uploading - 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>- 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.htmlStep 6 — Test Your Site
Section titled “Step 6 — Test Your Site”- Open your browser
- Go to your domain
- Check that:
- The homepage loads
- Links work
- Images appear
- The contact form works
How to Update Your Site Later
Section titled “How to Update Your Site Later”Every time you change content:
- Edit your files locally
- Run
npm run build - Upload the new
dist/contents again - 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 .
What About Node.js on the Server?
Section titled “What About Node.js on the Server?”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.
Troubleshooting
Section titled “Troubleshooting”| 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 . |
Next Step
Section titled “Next Step”After deploying, you can set up your custom domain, add SSL, or continue using other deployment methods.