Close Menu
GeekBlog

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Bill Gates Says the Next Year of AI Belongs to Hackers, Not Rogue Robots

    October 13, 2026

    Apple Watch Series 12 and Ultra 4 Owners Report Skin Irritation: What We Know So Far

    October 13, 2026

    Ukraine Knocked Out Three Yandex Data Centers. Russian Taxi Drivers Were Told to Use Google Maps.

    October 13, 2026
    Facebook
    GeekBlog
    • Home
    • Mobile
    • Tech News
    • Blog
    • Gaming
    • Smartwatch
    • How-To Guides
    • AI & Software
    Facebook
    GeekBlog
    Home»Blog»How to Deploy AngularJS on DreamHost (SFTP, .htaccess, HTTPS and Caching)
    Blog

    How to Deploy AngularJS on DreamHost (SFTP, .htaccess, HTTPS and Caching)

    Ethan CaldwellBy Ethan CaldwellSeptember 9, 202611 Mins Read
    Share Facebook Twitter Pinterest LinkedIn Tumblr Email Copy Link
    JavaScript code on a screen for deploying an AngularJS app on DreamHost
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link

    Deploying an AngularJS app on DreamHost comes down to uploading static files: you build the app locally, copy the output into the domain’s web folder over SFTP, add an .htaccess file so deep links work, and turn on the free Let’s Encrypt certificate in the DreamHost panel. There is no Node process to run on the server because AngularJS (the 1.x line) executes entirely in the browser. That makes it one of the easiest frameworks to host on a shared plan.

    Quick answer: Build (or simply gather) your AngularJS files, connect to DreamHost with SFTP using a shell or SFTP user, upload everything into /home/USER/example.com/, drop in an .htaccess with a rewrite rule that sends unknown paths to index.html if you use html5Mode, then enable HTTPS under Websites, then Secure Certificates in the panel. Add cache headers for hashed assets and you are done. Note that AngularJS reached end of life in January 2022, so treat this as maintaining a legacy app rather than starting a new one.

    This guide walks through a legacy AngularJS 1.x project on DreamHost Shared hosting. The same steps work on DreamHost VPS. At the end there is a short section on how a modern Angular project (version 2 and later) differs, because the two are often confused.

    Before you start: AngularJS is end of life

    AngularJS, meaning the 1.x framework loaded with a <script> tag and bootstrapped with ng-app, stopped receiving updates from Google on December 31, 2021. The team published the details on the official version support page. Since January 2022 there have been no security patches from the project. That does not stop the code from running, and thousands of internal tools still do, but it means two things for your deployment.

    • Pin the exact angular.js version you tested with. Do not load latest from a CDN, because there is no latest anymore and you want reproducible files.
    • Serve everything over HTTPS and set a Content Security Policy if the app handles anything sensitive, because the framework itself will not get fixes for browser level issues.

    If you are starting a new project, use modern Angular, or one of the alternatives we covered in where you can deploy Vue.js. The hosting steps below are almost identical for any single page app.

    Step 1: produce the deployable files

    An AngularJS project is deployable in one of two shapes.

    No build tool

    Many older apps are just a folder with index.html, js/, css/, templates under views/, and vendor scripts. That folder is the deployable. Remove anything you do not want public (.git, sample data with real records) and move on to Step 2.

    Grunt, Gulp or Webpack

    If the project uses a task runner, run its production task and deploy the output directory only. The names vary by project, but the common patterns are:

    npm install
    # one of the following, check package.json "scripts"
    npm run build
    grunt build
    gulp build
    npx webpack --mode production

    Look for a dist/ or build/ folder afterward. Old projects often need an older Node version to build; install nvm and run nvm install 14 or nvm install 10 to match what the project’s .nvmrc expects.

    Tip: Set the API base URL to a relative path or an environment specific constant before building. Hard coded http://localhost:3000 strings are the number one reason a freshly uploaded AngularJS app shows an empty page on the live domain.

    Step 2: find the web folder and create an SFTP user

    On DreamHost, each domain is served from a folder in the home directory of the user that owns it. The default path is /home/USERNAME/example.com/, and you can confirm or change it under Websites, then Manage Websites, then the domain’s Manage button, in the Web Directory field.

    Recommended for you:

    How to Use Regular Expressions in Jinja2
    Blog·Sep 9, 2026

    How to Use Regular Expressions in Jinja2

    To upload you need a user with SFTP or shell access. In the panel go to Users, then Manage Users. Edit the user that owns the domain and set the type to Shell user if you want ssh and rsync, or SFTP user if you only want file transfer. DreamHost disables plain FTP by default on new accounts, and you should leave it disabled.

    SettingValue
    HostYour server name from the panel (for example iad1-shared-b7-01.dreamhost.com) or the domain itself once DNS points at DreamHost
    Port22
    ProtocolSFTP (SSH File Transfer Protocol)
    Remote directory/home/USERNAME/example.com/
    AuthPassword, or an SSH key added under the user’s settings

    Step 3: upload the files

    With FileZilla or Cyberduck, connect with the details above, open the domain folder, delete the placeholder files DreamHost put there, and drag your app contents in. The index.html must end up directly inside the domain folder, not in a subfolder named dist.

    From a terminal, rsync over SSH is faster for repeat deploys because it only sends changed files and removes files you deleted locally:

    rsync -avz --delete ./dist/ USERNAME@example.com:/home/USERNAME/example.com/

    The trailing slash after dist/ matters. Without it rsync creates a dist folder on the server. Wrap that line in a tiny deploy.sh and you have a one command release. If you would rather push from a git remote or a CI job, the approach in our guide to launching Gatsby on Vultr translates directly, since a Gatsby build is also just static output.

    Step 4: add .htaccess for html5Mode routing

    AngularJS routes with either hash URLs (/#/users/42) or, when $locationProvider.html5Mode(true) is set, clean URLs (/users/42). Hash URLs need nothing from the server. Clean URLs do, because when a visitor loads /users/42 directly, Apache looks for a file at that path, finds nothing, and returns a 404 before AngularJS ever runs.

    DreamHost shared hosting runs Apache with mod_rewrite enabled, so create a file named .htaccess in the domain folder with this content:

    RewriteEngine On
    RewriteBase /
    
    # serve real files and folders as they are
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    
    # everything else goes to the app shell
    RewriteRule ^ index.html [L]

    Also make sure your index.html has <base href="/"> in the <head>, which html5Mode requires so that relative template and asset paths resolve from the root regardless of the current route. If the app lives in a subfolder such as /app/, set RewriteBase /app/, the base href to /app/, and the final rule to RewriteRule ^ /app/index.html [L].

    Step 5: enable HTTPS with Let’s Encrypt

    DreamHost issues and renews Let’s Encrypt certificates for free from the panel. Go to Websites, then Secure Certificates, find the domain, click Add, choose Let’s Encrypt, and confirm. Issuance usually completes within a few minutes once DNS is pointing at DreamHost. Renewal is automatic.

    Then force HTTPS. You can toggle it in the panel (Websites, then Manage Websites, then the domain, look for the HTTPS redirect setting), or add it at the top of the same .htaccess above the routing rules:

    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

    Then check that every external script and API call also uses HTTPS, because a single http:// script tag is blocked as mixed content.

    Step 6: caching headers

    Static hosting is fast, but only if browsers are allowed to cache. The rule of thumb for a single page app is: cache hashed assets for a long time, never cache index.html. DreamHost’s Apache honors mod_expires and mod_headers directives in .htaccess:

    <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresByType text/css "access plus 1 year"
      ExpiresByType application/javascript "access plus 1 year"
      ExpiresByType image/png "access plus 1 year"
      ExpiresByType image/svg+xml "access plus 1 year"
      ExpiresByType font/woff2 "access plus 1 year"
    </IfModule>
    
    <FilesMatch "index\.html$">
      Header set Cache-Control "no-cache, no-store, must-revalidate"
    </FilesMatch>
    
    <IfModule mod_deflate.c>
      AddOutputFilterByType DEFLATE text/html text/css application/javascript application/json
    </IfModule>

    The one year rule is only safe if your build appends a content hash to file names (app.3f9c2a.js). If your project serves plain app.js, shorten those to a day or add a query string version to the script tags, otherwise returning visitors run stale code after every release.

    Warning: Do not cache AngularJS HTML templates under views/ for a year unless they are hashed too. Stale templates cause errors that only returning users see.

    How modern Angular differs

    If your project has an angular.json, TypeScript files and @angular/core in package.json, it is modern Angular, not AngularJS. The deployment target on DreamHost is the same (static files, same .htaccess), but the build is different:

    ng build --configuration production --base-href /
    # output lands in dist/PROJECT-NAME/browser/ on recent versions
    rsync -avz --delete dist/PROJECT-NAME/browser/ USERNAME@example.com:/home/USERNAME/example.com/

    Modern Angular always uses clean URLs, so the rewrite rule is mandatory rather than optional. It also hashes asset file names by default, which makes the long cache rule safe. Server side rendering with Angular SSR needs Node on the server and is not a fit for DreamHost Shared; use a DreamHost VPS or DreamCompute, or a platform built for Node.

    Troubleshooting

    Blank white page after upload

    Open the browser console. If you see 404s for js/app.js or similar, the files landed in a subfolder, or the base href does not match the folder. If you see a CORS or connection error, the API URL is still pointing at localhost. Rebuild with the production API address.

    Deep links return a DreamHost 404 page

    The .htaccess either did not upload (many SFTP clients hide dotfiles; enable Show hidden files) or has Windows line endings. Save it again as UTF-8 with Unix line endings and upload again. Confirm with ls -la over SSH.

    Internal Server Error (500) immediately after adding .htaccess

    A typo in a directive. Rename the file temporarily to confirm, then add rules back a block at a time. The Header directive fails if mod_headers is unavailable, so wrap it in <IfModule mod_headers.c>.

    Old version keeps loading after a deploy

    Recommended for you:

    How to Implement Facebook Comment Integration on My Website (And Why You No Longer Can)
    Blog·Sep 9, 2026

    How to Implement Facebook Comment Integration on My Website (And Why You No Longer Can)

    Browser cache. Verify with a hard refresh or a private window. If the new build appears there, your cache headers are working as designed and the fix is hashed file names. Also check that DreamHost’s optional server side caching is not enabled for the domain.

    Certificate shows as pending for hours

    Let’s Encrypt validation needs the domain’s A record to already resolve to DreamHost. Check DNS under Websites, then Manage Websites, then DNS, and wait for propagation before retrying.

    Frequently asked questions

    Do I need Node.js on DreamHost to run AngularJS?

    No. AngularJS runs entirely in the visitor’s browser. Node is only used on your own machine for the build tooling, if the project has any. The server just needs to send static files, which is exactly what DreamHost Shared hosting does with Apache. A backend API, if you have one, is a separate deployment.

    Can I host the API on DreamHost too?

    You can host a PHP or Python (Passenger) API on Shared hosting, and a Node API on a VPS. Put it on a subdomain such as api.example.com and configure CORS, or place it under the same domain and adjust the rewrite rule so /api/ paths are not sent to index.html. Our FuelPHP hosting guide covers the PHP side.

    Should I use hash URLs instead of html5Mode to avoid .htaccess?

    You can. Hash routing needs no server configuration and works from any static host. The cost is uglier URLs and weaker SEO for public content. For an internal tool that is a fine trade. For a public site, use html5Mode with the rewrite rule shown above.

    Is it safe to keep running an AngularJS app in 2026?

    It runs, but it is unsupported. Keep it behind HTTPS, restrict it to authenticated users where possible, avoid rendering untrusted HTML, and plan a migration. Commercial extended support exists from third parties if the app cannot be replaced soon. New features should go into a supported framework.

    Wrapping up

    An AngularJS deployment on DreamHost is a static upload with three finishing touches: a rewrite rule for clean URLs, a free Let’s Encrypt certificate, and cache headers that are aggressive for hashed files and off for index.html. The whole process fits in a fifteen minute session once the build works locally.

    Because the framework is end of life, use this setup to keep a legacy app healthy while you plan its replacement. The hosting side will carry over unchanged to modern Angular or any other single page framework.

    About this article: GeekBlog covers U.S. technology news, AI, phones, smartwatches and gaming. Every story is written and checked under our Editorial Policy. Spotted a mistake or have a story tip? Contact our editors.

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Telegram Email Copy Link
    Previous ArticleHow to Check If a Variable Exists in a Jinja2 Template
    Next Article How to Use an Enum Inside a Struct in C and C++
    Ethan Caldwell

      Ethan Caldwell is GeekBlog's resident Apple specialist, covering the entire Apple ecosystem: iPhone, iPad, Mac, Apple Watch, AirPods and the software that ties them together. A longtime iOS user and gadget collector, Ethan tracks Cupertino's every move, breaking down Apple keynotes, A- and M-series chip benchmarks, iOS feature updates and the rumor mill into clear, practical takes that help readers decide whether the latest Apple hardware is worth the upgrade.

      Related Posts

      10 Mins Read

      Google Ads Keyword Planner: How It Shows the Most Relevant Keywords

      11 Mins Read

      How to Use Remarketing Techniques for Better Conversions

      11 Mins Read

      How to Conduct A/B Testing for Marketing Campaigns

      10 Mins Read

      AMP for WP Plugin Vulnerability: What Was Fixed and What to Do

      11 Mins Read

      How to Create a Facebook Business Page in 2026

      11 Mins Read

      How to Convert GMT Time to Other Time Zones in C++

      Top Posts

      Every iPhone Camera Ranked in 2026 (Best to Worst)

      July 6, 2026269 Views

      Best Stores for Buying MP3 and Digital Music You Can Keep Forever (2026)

      August 2, 2025246 Views

      Why Is RedGifs Not Working? Causes & Fixes (2026)

      July 8, 2026164 Views
      Stay In Touch
      • Facebook

      Subscribe to Updates

      Get the latest tech news from FooBar about tech, design and biz.

      Most Popular

      iPhone Battery Replacement Cost: Every Model, Apple vs Repair Shop

      October 6, 2026111 Views

      One UI 9 Watch Beta Now Covers Three Galaxy Watch Generations: What You Get and How to Join

      October 4, 202667 Views

      Best Offline Music App in 2026: Free and Paid Picks

      October 7, 202665 Views
      Our Picks

      Bill Gates Says the Next Year of AI Belongs to Hackers, Not Rogue Robots

      October 13, 2026

      Apple Watch Series 12 and Ultra 4 Owners Report Skin Irritation: What We Know So Far

      October 13, 2026

      Ukraine Knocked Out Three Yandex Data Centers. Russian Taxi Drivers Were Told to Use Google Maps.

      October 13, 2026

      Subscribe to Updates

      Get the latest creative news from FooBar about art, design and business.

      HEICJPG.online - Convert HEIC to JPG online
      Facebook
      • About Us
      • Contact us
      • Privacy Policy
      • Disclaimer
      • Terms and Conditions
      • Editorial Policy
      • Cookie Policy
      • Your Privacy Choices
      © 2026 GeekBlog

      Type above and press Enter to search. Press Esc to cancel.