Publish the plugin¶
Let’s imagine that we are satisfied with our plugin and we would like to share it with our colleagues or other QGIS users. There are several steps which must be performed.
Create zip package¶
A zip package can be created by pb_tool (see Build the plugin). Go to your plugin directory and type:
pb_tool zip
A new zip file will be created in the current directory. This archive contains all necessary information in order to install the QGIS plugin.
Tip
Try to install QGIS plugin directly from this zip file. Go to
. Choose Install from ZIP.Task
Improve plugins metadata
Modify metadata.txt
file.
Official QGIS plugin repository¶
You can publish your plugin in official QGIS Plugin repository. Plugin must fulfill basic requirements (GNU GPL license, documentation included). You can upload the plugin at https://plugins.qgis.org/accounts/login/?next=/plugins/add/. Note that it can take few days when your plugin will be approved by the moderators.
Local QGIS plugin repository¶
It can be relatively easy to set up a local (in-house) QGIS plugin repository. It is only question of creating a XML file accessible via HTTP protocol (so web server must run in your infrastructure).
Simple example for our plugin:
<?xml version="1.0"?>
<plugins>
<pyqgis_plugin name="sav_views" version="0.1">
<description>Save views</description>
<homepage>https://github.com/gismentors/save_views</homepage>
<qgis_minimum_version>3.28</qgis_minimum_version>
<file_name>save_views.zip</file_name>
<author_name>GISMentors</author_name>
<download_url>http://server/save_views.zip</download_url>
</pyqgis_plugin>
</plugins>
Store it as qgis_plugins.xml
and check if the file is
accessible over HTTP protocol, eg. http://server/qgis_plugins.xml
.
Now add the new repository to QGIS. Go to
.Now you should see the plugin in the search list.
Tip
When searching for more advanced solutions take a look at https://github.com/boundlessgeo/qgis-plugin-repos/tree/master/docker-plugins-xml or similar solutions.