Start the Apache server. Go to the tileserver page (http://localhost/tileserver). Verify that your virtual domain is working, by going directly to yourdomain.example/tileserver and not localhost/tileserver.

Open QGIS and go to Plugins > Manage and install plugins. In the Plugins window, go to Settings and enable 'Show also experimental plugins'. Click reload repository. From 'All' search for the 'QTiles' plugin by NextGIS and install it.

Usage

I recommend only generating tiles up to zoom level 16 or less for Sentinel-2 (10 meter resolution), change the zoom level accordingly for higher or lower resolution imagery.

Saving the tiles to an SSD instead of to a mechanical HDD speeds up the process.

You don't need a very powerful CPU, I use a Pentium G4560, and generating tiles for one Sentinel-2 granule of about 50x50 km up to zoom level 16 takes around 10 minutes.

You can also generate tiles for only part of a GeoTIFF image. To do this, in QGIS, choose from the menu Raster > Extraction > Clipper. Save as a new file (e.g. crop.tif). Then in the Qtiles window, select the cropped layer.

Rename the JSON file to metadata.json and place it in the same folder as the tiles.

In JOSM, select your custom WMTS server and start tracing

Note: you can start tracing while the tiles are being generated, the processing starts from top left of the tile.