{"id":481,"date":"2024-10-07T22:11:57","date_gmt":"2024-10-07T22:11:57","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2024\/10\/07\/9967651-how-to-install-flutter-web-on-a-vps-at-hostinger\/"},"modified":"2026-10-08T07:31:39","modified_gmt":"2026-10-08T07:31:39","slug":"9967651-how-to-install-flutter-web-on-a-vps-at-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/9967651-how-to-install-flutter-web-on-a-vps-at-hostinger\/","title":{"rendered":"How to install Flutter Web on a VPS at Hostinger"},"content":{"rendered":"<p>To install Flutter Web on a <a data-click-id=\"hgr-post-content-link-hostinger-vps\" href=\"https:\/\/www.hostinger.com\/vps-hosting\">Hostinger VPS<\/a>, set up a Linux OS, connect over SSH, install Google Chrome and Flutter with Snap, enable web support, and open port 8080 in the firewall. Once these steps are done, you can open your Flutter web app from any browser using your VPS IP address.<\/p><h2 id=\"h_913951cdd1\"><b>Step 1 &ndash; Install OS for your VPS<\/b><\/h2><p class=\"no-margin\">You can choose any Linux OS for your VPS setup. In this tutorial, we will use <a data-click-id=\"hgr-post-content-link-ubuntu-26-04\" href=\"https:\/\/www.hostinger.com\/support\/9901438-how-to-set-up-ubuntu-remote-desktop-hostinger-vps\/\">Ubuntu 26.04<\/a> as an example.<\/p><h2 id=\"h_e4dd488014\"><b>Step 2 &ndash; Access your SSH client<\/b><\/h2><div class=\"intercom-container\"><img decoding=\"async\" class=\"alignnone wp-image-17822 size-large\" src=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/09\/2026-09-03_14-49-1024x381.png\" alt=\"\" width=\"1024\" height=\"381\" srcset=\"https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/09\/2026-09-03_14-49-1024x381.png 1024w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/09\/2026-09-03_14-49-300x112.png 300w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/09\/2026-09-03_14-49-768x286.png 768w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/09\/2026-09-03_14-49-1536x572.png 1536w, https:\/\/www.hostinger.com\/support\/wp-content\/uploads\/sites\/55\/2026\/09\/2026-09-03_14-49-2048x762.png 2048w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/div><p class=\"no-margin\">Access the <b>VPS Overview <\/b>page and select your preferred method for connecting to your SSH client. You can use the browser-based web console (located in the top right corner) or the command <code>ssh root@your_vps_ip<\/code> in your Terminal or Putty for manual connection.<\/p><h2 id=\"h_64bbd1111b\"><b>Step 3 &ndash; Building Flutter Web on VPS<\/b><\/h2><h3 id=\"h_892f25874c\"><b>1. Install Google Chrome on your VPS<\/b><\/h3><p class=\"no-margin\">Google Chrome is essential for running and debugging Flutter web apps. Download the latest version of Google Chrome for Linux:<\/p><p class=\"no-margin\"><code>wget <a data-click-id=\"hgr-post-content-link-https-dl-google-com-linux-direct-google-chrome-stable_curren\" class=\"intercom-content-link\" href=\"https:\/\/dl.google.com\/linux\/direct\/google-chrome-stable_current_amd64.deb\" target=\"_blank\" rel=\"noopener\">https:\/\/dl.google.com\/linux\/direct\/google-chrome-stable_current_amd64.deb<\/a><\/code><\/p><h3 id=\"h_e3e0551e53\"><b>2. Install the downloaded Chrome package:<\/b><\/h3><p class=\"no-margin\"><code>sudo apt install .\/google-chrome-stable_current_amd64.deb<\/code><\/p><h3 id=\"h_8d8f4ba540\"><b>3. Set Chrome Environment Variable<\/b><\/h3><p class=\"no-margin\">After installing Chrome, set the <code>CHROME_EXECUTABLE<\/code> environment variable, so Flutter knows where Chrome is located. Add the following line to your <code>.bashrc<\/code> file to export the Chrome path:<\/p><p class=\"no-margin\">&#8203;<code>echo 'export CHROME_EXECUTABLE=\/usr\/bin\/google-chrome' &gt;&gt; ~\/.bashrc<\/code><\/p><p class=\"no-margin\">Apply the changes made in .bashrc to your current session:<\/p><p class=\"no-margin\"><code>source ~\/.bashrc<\/code><\/p><h3 id=\"h_27ca4f4d3c\"><b>4. Install Flutter via Snap<\/b><\/h3><p class=\"no-margin\">Flutter can be installed easily using the Snap package manager.<\/p><p class=\"no-margin\">Update your package list:<\/p><p class=\"no-margin\"><code>sudo apt update<\/code><\/p><p class=\"no-margin\">Install Snap if you don&rsquo;t have it already:<\/p><p class=\"no-margin\"><code>sudo apt install snapd<\/code><\/p><p class=\"no-margin\">Install Flutter via Snap with classic mode enabled:<\/p><p class=\"no-margin\"><code>sudo snap install flutter --classic<\/code><\/p><h3 id=\"h_0326f75dac\">5. Enable Web Support in Flutter<\/h3><p class=\"no-margin\">Flutter needs to be configured to support web development, run the following command to enable web support in Flutter:<\/p><p class=\"no-margin\"><code>flutter config --enable-web<\/code><\/p><h3 id=\"h_b0e3d36957\">6. Create and Run a Flutter Web Project<\/h3><p class=\"no-margin\">Now that Flutter is installed and configured for the web, you can create and run your first web project:<\/p><p class=\"no-margin\"><code>flutter create my_web_app<\/code><\/p><p class=\"no-margin\">Navigate into the project directory:<\/p><p class=\"no-margin\"><code>cd my_web_app<\/code><\/p><p class=\"no-margin\">Run the app using the web server device (with a custom port and hostname):<\/p><p class=\"no-margin\"><code>flutter run -d web-server --web-port=8080 --web-hostname=0.0.0.0<\/code><\/p><h2 id=\"h_1010ec8a17\"><b>Step 4 &ndash; Configure firewall to allow web traffic<\/b><\/h2><p class=\"no-margin\">To access your Flutter web app from outside the VPS, ensure your firewall allows traffic on port 8080. Allow incoming TCP traffic on port 8080:<\/p><p class=\"no-margin\"><code>sudo ufw allow 8080\/tcp<\/code><\/p><p class=\"no-margin\">Reload the firewall to apply the changes:<\/p><p class=\"no-margin\"><code>sudo ufw reload<\/code><\/p><h2 id=\"h_e5d25db3c4\"><b>Step 5 &ndash; Access your Flutter Web App<\/b><\/h2><p class=\"no-margin\">Once the app is running, you can access it from any browser. Open your browser and navigate to the following URL, replacing <code>your_ip<\/code> address with your VPS IP address:<\/p><p class=\"no-margin\"><code>http:\/\/your_ip:8080<\/code><\/p><p class=\"no-margin\">Your Flutter web app is now built and deployed to your VPS!<\/p><div class=\"intercom-container\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2024\/10\/e3a353c3-1da8-4c84-92e4-b6697b4020bd.jpg\" alt=\"Flutter demo home page with counter at 2 and a plus button in the bottom-right corner\" data-media-id=\"2337\"><\/div><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p class=\"no-margin\">For further development, please check the official <a data-click-id=\"hgr-post-content-link-flutter-documentation\" class=\"intercom-content-link\" href=\"https:\/\/docs.flutter.dev\/get-started\/learn-flutter\" target=\"_blank\" rel=\"noopener\">Flutter documentation<\/a><\/p>\n<\/div><p class=\"no-margin\">\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting started with the Flutter web on a VPS<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[199],"tags":[],"class_list":["post-481","post","type-post","status-publish","format-standard","hentry","category-vps-management"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/9967651-how-to-install-flutter-web-on-a-vps-at-hostinger","default":1}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/481","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=481"}],"version-history":[{"count":6,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/481\/revisions"}],"predecessor-version":[{"id":19940,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/481\/revisions\/19940"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=481"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=481"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=481"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}