How to run a VersaTiles server on Uberspace
In this guide, we will explain how to set up and run a VersaTiles server on ↗ Uberspace.
Install Versatiles
Uberspace comes with rust already in place. You can simply install the versatiles crate:
cargo install versatilesDownload tiles
Download the full planet
WARNING
Uberspace has a ↗ user quota of 10GB by default. You have to ↗ upgrade your storage if you want to serve the full planet.
wget -c https://download.versatiles.org/osm-vector/osm-vector.versatilesAlternative: Download a regional subset
You can quite easily download only a certain area, using the versatiles tool with the --bbox option. You can use this ↗ BoundingBox tool with the CSV option to easily create a bounding box for your desired area.
For example:
versatiles convert --bbox-border 3 --bbox "5.988,47.302,15.017,54.983" https://download.versatiles.org/osm-vector/osm-vector.versatiles osm-vector.versatilesLearn more about downloading tiles
Download Frontend
The frontend contains static files such as libraries, map styles, and fonts.
wget https://github.com/versatiles-org/versatiles-frontend/releases/latest/download/frontend.br.tar.gzNOTE
There is no need to extract this file.
Run Server
Use your favourite editor to create ~/etc/services.d/versatiles.ini. Use any port between 1024 and 65535 you like. This example uses 41241.
WARNING
Make sure to replace <username> with your actual username and check if the paths correspond to the files you downloaded.
[program:versatiles]
command=/home/<username>/.cargo/bin/versatiles serve -i 0.0.0.0 -p 41241 -s /home/<username>/frontend.br.tar.gz --immutable "assets/lib/*@*/**" "[osm-vector]/home/<username>/osm-vector.versatiles"
startsecs=60--immutable lets browsers keep the frontend's versioned libraries for a year, while all other files are checked on every page load, so an updated frontend shows at once. The Caching page explains it.
Now you can use supervisorctl to start the versatiles server as a daemon:
supervisorctl reread
supervisorctl updateExpose Server as Web Backend
uberspace web backend set / --http --port 41241The VersaTiles server will now be running locally on your Uberspace host. To test it open http://<username>.uber.space/ in your browser.
Refer to the ↗ Uberspace manual for further questions regarding Uberspace.
For more information, see the documentation on using the VersaTiles server.