Skip to content

Latest commit

 

History

History
83 lines (62 loc) · 1.67 KB

File metadata and controls

83 lines (62 loc) · 1.67 KB

How to run a VersaTiles server with nginx on Debian

Your server requires as an absolute minimum:

  • 2 CPU cores
  • 4 GB RAM
  • 60 GB free disk space

0. Create a user "versatiles"

1. Update the server and install dependencies

sudo apt update
sudo apt -q install -y curl nginx build-essential libsqlite3-dev pkg-config openssl libssl-dev # git wget unzip tmux htop sysstat brotli cmake ifstat gnupg2 ca-certificates lsb-release

2. Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"

3. Install VersaTiles

cargo install versatiles

4. Download frontend and tiles

cd ~
mkdir versatiles
cd versatiles
curl -Lo frontend.br.tar.gz "https://github.com/versatiles-org/versatiles-frontend/releases/latest/download/frontend.br.tar.gz"
curl -Lo osm.versatiles "https://download.versatiles.org/osm.versatiles"

Warning

The following steps (5-7) have not been fully tested. Please verify carefully and report any issues.

5. config nginx

sudo nano /etc/nginx/sites-available/default
# add:
# location / {
#   proxy_pass http://localhost:8080/;
# }
sudo systemctl restart nginx

6. prepare a VersaTiles service

sudo cat > /etc/systemd/system/versatiles.service <<EOF
[Unit]
Description=VersaTiles server

[Install]
WantedBy=multi-user.target

[Service]
Type=simple
ExecStart=versatiles serve "[osm]osm.versatiles" -s frontend.br.tar.gz -p 8080
WorkingDirectory=/home/versatiles/versatiles
Restart=always
RestartSec=5
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=%n
EOF

7. start service

sudo systemctl start versatiles