How to Publish a QGIS Map Online for Free With QGIS2Web
- Primary Signal: How to Publish a QGIS Map Online for Free With QGIS2Web
- Overview: QGIS2Web turns a QGIS project into a working web map you can host for free, with layers, popups and a search box. This guide covers preparing the project, choosing Leaflet or OpenL...
- Verification: Analyzed and compiled by FreeSky GeoData editorial monitoring desk.
Making a map in QGIS is only half the job. The other half is getting it in front of people, and most of the people who need to see your map do not have QGIS installed and never will. QGIS2Web solves that: it is a free plugin that exports a QGIS project as a self-contained web map, a folder of HTML, JavaScript and data files that anyone can open in a browser. The result has pan and zoom, layer switching, popups with your attribute data, and optionally a search box and a measure tool, and you can host it for free on GitHub Pages or any static hosting.
The plugin offers two output engines, Leaflet and OpenLayers, and the choice is mostly a matter of taste. Leaflet produces a lighter, simpler map that is easy to customise, while OpenLayers offers more built-in controls and handles complex styling slightly better. For a first map, Leaflet is the friendlier choice. Either way, the workflow is the same: prepare the project, run the plugin, check the output locally, and upload the folder to a host.
Prepare the QGIS project first
A web map is only as good as the project it comes from, so clean up before exporting. Set the project CRS to WGS84, EPSG:4326, because web maps expect geographic coordinates, and reproject any layers that are in another CRS. Simplify the styling: web maps handle simple fills, outlines and labels well, but complex rule-based symbology and data-defined overrides often export badly. Keep the layer list short, ideally under ten layers, and give each layer a clear name, because the layer name becomes the label in the web map's layer switcher.
Check the attribute tables too. Every field in your layer becomes a column in the popup, so remove fields you do not want the public to see, such as internal IDs or personal data, and rename cryptic field names to something readable. Decide which fields appear in popups and which do not; QGIS2Web lets you choose per field. Finally, set the project extent to the area you want the map to open on, and save the project, because the plugin reads the saved state.
Run QGIS2Web and check the output
Install QGIS2Web from the Plugins menu if you have not already, then open it from the Web menu. Choose Leaflet or OpenLayers, set the export folder, and work through the tabs. The Layers tab lets you set popups, clustering for point layers, and whether each layer is visible by default. The Appearance tab sets the title, the basemap, and whether to add a search box, a measure tool or a layer list. The Export tab has the button that builds the map.
Before uploading anything, test the map locally by opening the index.html file in the export folder with a browser. Click every layer, open a few popups, try the search, and check the map on a phone-sized window as well as a desktop. Common problems are popups showing empty fields, which means the field list needs trimming, and layers that do not draw, which usually means a styling choice that did not export. Fix these in QGIS and re-export; the plugin overwrites the folder cleanly each time.
Host it for free on GitHub Pages
The export folder is a static website, so any static host will serve it, and GitHub Pages is the simplest free option. Create a repository, upload the contents of the export folder, and enable Pages in the repository settings. GitHub gives you a public URL, and anyone with the link can open your map. The whole process takes a few minutes once you have done it once, and the map stays live until you change or delete the repository.
Keep the data size in mind. A web map that loads a ten-megabyte GeoJSON file will feel slow, especially on a phone, so simplify geometries before export: use the Simplify tool on polygon layers and drop unnecessary vertices. If your data is large, consider serving it as vector tiles instead, or splitting it into a few layers that load on demand. And remember that anything you publish is public, so never include personal data, precise locations of vulnerable features, or anything you do not have the right to share.
Frequently Asked Questions
Q: What is QGIS2Web?
A: A free QGIS plugin that exports a QGIS project as a self-contained web map using Leaflet or OpenLayers. The output is a folder of HTML and JavaScript files you can host anywhere, including free static hosts such as GitHub Pages.
Q: Can I use QGIS2Web with my own basemap?
A: Yes. The Appearance tab offers several basemaps including OpenStreetMap, and you can add XYZ tile layers from other providers in QGIS before exporting, which the plugin will include.
Q: Why do my popups show empty or unwanted fields?
A: QGIS2Web includes every attribute field by default. Open the layer properties, use the Attributes Form settings to hide fields you do not want, or set the popup fields in the plugin's Layers tab before exporting.
📖 Continue Reading the Full Story
Continue reading this article on FreeSky GeoData.
⚡ Access Full Content Now