Appearance
Deploy to cPanel & shared hosting
Most hosting plans sold in Tanzania and East Africa, often bundled with a .co.tz or .com domain and business email, come with cPanel (or a similar panel such as DirectAdmin or Plesk). Your template works perfectly there: you build it on your computer and upload the files. Nothing needs to be installed on the server, and you don't need Node.js on the hosting.
1. Build on your computer
bash
npm install
npm run buildYou now have a dist/ folder containing index.html and an assets/ folder. These are the only files you upload.
Upload the contents, not the folder
Upload what is inside dist/, so that index.html sits directly in public_html/. If you upload the dist folder itself, your site ends up at yourdomain.com/dist/ and the home page shows the host's default page (or a directory listing).
2a. Upload with cPanel File Manager
The easiest way, all in the browser.
- Make a ZIP of the contents of
dist/:- Windows: open
dist, select everything (Ctrl + A), right-click → Send to → Compressed (zipped) folder. - macOS: open
dist, select everything, right-click → Compress.
- Windows: open
- Sign in to cPanel (usually
https://yourdomain.com/cpanelor the link from your host) → File Manager. - Open
public_html(for an addon domain or subdomain, open its own document root folder instead). - Delete or move away the host's placeholder files (
index.html,default.html,index.php) so they don't override yours. Keep.well-known/andcgi-bin/if present. - Click Upload, choose your ZIP and wait for 100 %.
- Back in File Manager, right-click the ZIP → Extract → into
public_html. Then delete the ZIP. - Open
https://yourdomain.com. Done.
2b. Upload with FTP
Good for repeated updates. Use FileZilla (free) or any FTP client.
- In cPanel, open FTP Accounts and create an account (or use the main cPanel login). Note the server, username, password and port (21 for FTP, or use SFTP on port 22 if your host supports it).
- In FileZilla: File → Site Manager → New site. Protocol FTP with "Require explicit FTP over TLS" (or SFTP), enter the details, Connect.
- On the right (server), open
public_html. - On the left (your computer), open your project's
distfolder. - Select everything inside
distand drag it to the right side. Choose Overwrite if asked.
When you update the site later, upload the new dist contents again. Vite gives changed files new names (index-3f9a2c1b.js), so you can delete the old files in assets/ from time to time.
Installing in a sub-folder
Want the site at yourdomain.com/new-site/? Create the folder public_html/new-site/ and upload the dist contents into it. No config change is needed: the template's base: './' makes all paths relative.
Recommended .htaccess
Most shared hosts run Apache or LiteSpeed. Create a file named .htaccess in public/ of your project (so it is copied into dist/ on every build), with:
apache
# Force HTTPS
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Long cache for hashed build files, no cache for the page itself
<IfModule mod_headers.c>
<FilesMatch "\.(js|css|webp|jpg|jpeg|png|svg|woff2)$">
Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>
<FilesMatch "\.html$">
Header set Cache-Control "no-cache"
</FilesMatch>
</IfModule>
# Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css application/javascript image/svg+xml
</IfModule>Hidden files
File names starting with a dot are hidden by default. In File Manager, click Settings → Show Hidden Files (dotfiles). In FileZilla: Server → Force showing hidden files.
HTTPS on cPanel
Most hosts include free certificates through AutoSSL or Let's Encrypt.
- cPanel → SSL/TLS Status (or Let's Encrypt SSL).
- Select your domain and
www.version → Run AutoSSL (or Issue). - Wait a few minutes, then visit
https://yourdomain.com. The.htaccessabove sends visitors fromhttp://tohttps://.
If the certificate fails, the domain usually isn't pointing at the host yet. Check that the domain's DNS A record matches the server IP shown in cPanel (right sidebar, Shared IP Address).
Troubleshooting on shared hosting
- The host's default page still shows: an old
index.html/index.php/default.htmlis still inpublic_html. Delete it. - Blank page: files were uploaded inside an extra folder, or only
index.htmlwas uploaded withoutassets/. See Blank page after deploy. - Images missing: the server is case-sensitive. Check file name capitals. See Images not showing.
- Old version still showing: your browser or the host's cache. Hard-refresh, or clear the cache in your host's panel (LiteSpeed Cache, Cloudflare).