Build Your Own OpenStreetMap Tile Server on Ubuntu 16.04

OpenStreetMap, aka OSM, is a user contributed world map that is freely editable. You can think of it as an open-source and self-hosted alternative to Google Maps. This tutorial will show you how to build your own OpenStreetMap tile server on Ubuntu 16.04 so you don’t have to use a proprietary map service.

Note: This tutorial is a bit outdated. Please read my updated tutorial here: How to set up OpenStreetMap tile server on Ubuntu 18.04.

OpenStreetMap Features

  • OpenStreetMap data covers the whole world, making it easy to support users in any country, or every country.
  • OpenStreetMap is updated every minute of every hour of every day, and these updates are available to you in real-time.
  • OpenStreetMap data is free and open – there is no subscription fee and no page-view fee.
  • OpenStreetMap data is rich and detailed, containing huge amounts of data which is relevant to people on the ground – the people who collected it.

Prerequisites/Hardware Requirements

The required RAM and disk space depends on which country’s map you are going to use. For example,

  • The UK map requires at least 12G RAM and 60GB disk space.
  • The whole planet map requires at least 32G RAM and 1TB SSD disk. It’s not viable to use a spinning hard disk for the whole planet map.

You will need more disk space if you are going to pre-render tiles to speed up map loading in web browser, which is highly recommended. Check this page to see how much disk space are required for pre-rendering tiles. Another thing to note is that importing large map data, like the whole planet, to PostgreSQL database takes a long time. Consider adding more RAM and especially using SSD instead of spinning hard disk to speed up the import process.

If you are going to host the entire world map, I recommend you buy the extra large VPS from Contabo, which boasts

  • A 10 core CPU
  • 60 GB RAM
  • 1.6 TB Intel Optane SSD

It costs just 26.99 €/month.

Step 1: Upgrade Software

sudo apt update

sudo apt upgrade

Step 2: Install PostgreSQL Database Server with PostGIS

We will use PostgreSQL to store map data. PostGIS is a geospatial extenstion to PostgreSQL. Run the following commands to install them.

sudo apt install postgresql postgresql-contrib postgis postgresql-9.5-postgis-2.2

The postgres user will be created on the OS during the installation process. It’s the super user for PostgreSQL database server. By default, this user has no password and there’s no need to set one because you can use sudo to switch to the postgres user:

sudo -u postgres -i

Now you can create a PostgreSQL database user osm.

createuser osm

Create a database named gis and at the same time make osm as the owner of the database. -E UTF8 specifies the character encoding scheme to be used in the database is UTF8.

createdb -E UTF8 -O osm gis

Create hstore and postgis extension on the gis database.

psql -c "CREATE EXTENSION hstore;" -d gis

psql -c "CREATE EXTENSION postgis;" -d gis

Exit from the postgres user.


Create osm user on your operating system so the tile server can run as osm user.

sudo adduser osm

Step 3: Download Map Stylesheet and Map Data

First switch to osm user

su - osm

Download the latest CartoCSS map stylesheets to the osm user’s home directory.


Extract it.

tar xvf v2.41.0.tar.gz

Next, download map data to the osm user’s home directory. Use the below command to download the map data of the whole planet (32G).

wget -c

If you want a map of individual country or state, go to Also, provides extracts of more than 200 cities and regions world-wide in different formats.

For example, download the map data of Great Britain (847M).

wget -c

Now exit from the osm user.


Recommendations before Importing Map Data

Importing map data takes a lot of RAM. If your physical memory is small, you can easily add a swap file. First we use fallocate command to create a file. For example, create a file named swapfile with 2G capacity in root file system:

sudo fallocate -l 2G /swapfile

Then make sure only root can read and write to it.

sudo chmod 600 /swapfile

Format it to swap:

sudo mkswap /swapfile


Setting up swapspace version 1, size = 2097148 KiB
no label, UUID=h32b3e10-0779-4865-9ea0-6e2af8f3kea9

Enable the swap file

sudo swapon /swapfile

The import process can take some time. It’s recommended to configure SSH keepalive so that you don’t lose the SSH connection. It’s very easy to do. Just open the SSH client configuration file on your local Linux machine.

sudo nano /etc/ssh/ssh_config

And paste the following text at the end of the file.

ServerAliveInterval 60

Then save the file and connect to your Ubuntu 16.04 server

Step 4: Import the Map Data to PostgreSQL

To import map data, we need to install osm2pgsql which converts OpenStreetMap data to postGIS-enabled PostgreSQL databases.

sudo apt install osm2pgsql

Switch to osm user again.

su - osm

Run the following command to load map stylesheet and map data into the gis Database. Replace great-britain-latest.osm.pbf with your own map data file.

osm2pgsql --slim -d gis -C 3600 --hstore -S openstreetmap-carto-2.41.0/ great-britain-latest.osm.pbf

osm2gpsql will run in slim mode which is recommended over the normal mode. -d stands for --database. -C flag specify the cache size in MB. Bigger cache size results in faster import speed but you need to have enough RAM to use cache. -S flag specify the style file. And finally you need to specify the map data file.

Once the import is complete, exit from the osm user.


Step 5: Install mod_tile

mod_tile is an Apache module that is required to serve tiles. Currently no binary package is available for Ubuntu. We can compile it from Github repository.

First install build dependency.

sudo apt install git autoconf libtool libmapnik-dev apache2-dev

Then clone the repository from Github.

git clone

cd mod_tile/

Compile and install

sudo make install
sudo make install-mod_tile

Step 6: Generate Mapnik Stylesheet

Install required packages.

sudo apt install curl unzip gdal-bin mapnik-utils node-carto

Switch to osm user.

su - osm

Cd into the carto style directory.

cd openstreetmap-carto-2.41.0/

Get shapefiles.


Now build the Mapnik xml stylesheet.

carto project.mml > style.xml

Exit from the osm user.


Step 7: Configuring renderd

Edit renderd config file.

sudo nano /usr/local/etc/renderd.conf

In the [default] section, change the value of XML and HOST to the following.


In [mapnik] section, change the value of plugins_dir.


Save the file.

Install renderd init script by copying the sample init script.

sudo cp mod_tile/debian/renderd.init /etc/init.d/renderd

Grant execute permission.

sudo chmod a+x /etc/init.d/renderd

Edit the init script file

sudo nano /etc/init.d/renderd

Change the following variable.

DAEMON_ARGS="-c /usr/local/etc/renderd.conf"

Save the file.

Create the following file and set osm the owner.

sudo mkdir -p /var/lib/mod_tile

sudo chown osm:osm /var/lib/mod_tile

Then start renderd service

sudo systemctl daemon-reload

sudo systemctl start renderd

sudo systemctl enable renderd

Step 8: Configure Apache

Install Apache web server

sudo apt install apache2

Create a module load file.

sudo nano /etc/apache2/mods-available/mod_tile.load

Paste the following line into the file.

LoadModule tile_module /usr/lib/apache2/modules/

Create a symlink.

sudo ln -s /etc/apache2/mods-available/mod_tile.load /etc/apache2/mods-enabled/

Then edit the default virtual host file.

sudo nano /etc/apache2/sites-enabled/000-default.conf

Paste the following lines in <VirtualHost *:80>

LoadTileConfigFile /usr/local/etc/renderd.conf
ModTileRenderdSocketName /var/run/renderd/renderd.sock
# Timeout before giving up for a tile to be rendered
ModTileRequestTimeout 0
# Timeout before giving up for a tile to be rendered that is otherwise missing
ModTileMissingRequestTimeout 30

Save and close the file. Restart Apache.

sudo systemctl restart apache2

Then in your web browser address bar, type


You should see the tile of world map. Congrats! You just successfully built your own OSM tile server.

Display Your Tiled Web Map

Tiled web map is also known as slippy map in OpenStreetMap terminology. There are two free and open source JavaScript map libraries you can use for your tile server: OpenLayer and Leaflet. The advantage of Leaflet is that it is simple to use and your map will be mobile-friendly.


To display your slippy map with OpenLayer, download JavaScript and CSS from and extract it to the web root folder.

cd /var/www/html

sudo wget

sudo unzip

Next, create the index.html file.

sudo nano /var/www/html/index.html

Paste the following HTML code in the file. Replace red-colored text and adjust the longitude, latitude and zoom level according to your needs.

<!DOCTYPE html>
<title>Accessible Map</title>
<link rel="stylesheet" href="http://your-ip/v4.3.4/css/ol.css" type="text/css">
<script src="http://your-ip/v4.3.4/build/ol.js"></script>
  a.skiplink {
    position: absolute;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 0;
    border: 0;
    height: 1px;
    width: 1px;
    overflow: hidden;
  a.skiplink:focus {
    clip: auto;
    height: auto;
    width: auto;
    background-color: #fff;
    padding: 0.3em;
  #map:focus {
    outline: #4A74A8 solid 0.15em;
  <a class="skiplink" href="#map">Go to map</a>
  <div id="map" class="map" tabindex="0"></div>
  <button id="zoom-out">Zoom out</button>
  <button id="zoom-in">Zoom in</button>
    var map = new ol.Map({
      layers: [
        new ol.layer.Tile({
          source: new ol.source.OSM({
             url: 'http://your-ip/osm_tiles/{z}/{x}/{y}.png'
     target: 'map',
     controls: ol.control.defaults({
        attributionOptions: /** @type {olx.control.AttributionOptions} */ ({
          collapsible: false
    view: new ol.View({
       center: [244780.24508882355, 7386452.183179816],

  document.getElementById('zoom-out').onclick = function() {
    var view = map.getView();
    var zoom = view.getZoom();
    view.setZoom(zoom - 1);

  document.getElementById('zoom-in').onclick = function() {
     var view = map.getView();
     var zoom = view.getZoom();
     view.setZoom(zoom + 1);

Save and close the file. Now you can view your slippy map by typing your server IP address in browser.

your-ip/index.html           or          your-ip


To display your slippy map with Leftlet, download JavaScript and CSS from and extract it to the web root folder.

cd /var/www/html/

sudo wget

sudo unzip

Next, create the index.html file.

sudo nano /var/www/html/index.html

Paste the following HTML code in the file. Replace red-colored text and adjust the longitude, latitude and zoom level according to your needs.

<title>My first osm</title>
<link rel="stylesheet" type="text/css" href="leaflet.css"/>
<script type="text/javascript" src="leaflet.js"></script>

  <div id="map"></div>
    var map ='map').setView([53.555,9.899],5);

Save and close the file. Now you can view your slippy map by typing your server IP address in browser.

your-ip/index.html           or          your-ip

openstreetmap tile server setup

To pre-render tiles instead of rendering on the fly, use render_list command. Pre-rendered tiles will be cached in /var/lib/mod_tile directory. -z and -Z flag specify the zoom level.

render_list -m default -a -z 0 -Z 10

This tutorial is made available with the help from Miles B. Dyson.

Rate this tutorial
[Total: 100 Average: 4.7]

64 Responses to “Build Your Own OpenStreetMap Tile Server on Ubuntu 16.04

    • Xiao Guoan
      6 years ago



        I have question regarding map updateing.

        Can you add to tutorial steps and possible timeframe (your opinion) to update map files and then other necessary commands to make server up2date using cron ?


  • hello mr guoan

    i follow every step of your tutoriel but i have problem to display maps.

    i download only a area of france:…

    when i lauchn my browser

    ( normally i have to see this tile because she’s in the package
    download (limousin-140101.osm.pbf)

    no maps but this text:

    NoResp200: 0
    NoResp304: 0
    NoResp404: 0
    NoResp503: 0
    NoResp5XX: 0
    NoRespOther: 0
    NoFreshCache: 0

    i have results with i try this request:

    psql -d gis -c “select name from planet_osm_point;”

    so i think my database seems works correctly

    thanks a lot for your response

    regards, nicolas

    • Xiao Guo-An (Admin)
      6 years ago

      Hi, to see the actual tile you should type


      instead of


      The latter contains the information about the tile.

      • i try this url but i have a 404 error
        Not Found

        The requested URL /osm_tiles/18/131989/93435.png was not found on this server.

        Apache/2.4.18 (Ubuntu) Server at Port 80)

        i follow every steps so i dont know where is the problem

        thanks a lot

        • Xiao Guoan
          6 years ago

          Can you give the link of your downloaded map? Sorry but you have to use HTML tag to add link in disqus comment system. Directly pasted link will be truncated by disqus.

          I will try to import your map data and see if it will work on my side.

        • hello mr guoan.

          i re test your tutorial and it works !!

          tanks a lot

          i have a bug because i have to write a new line:

          sudo gpasswd -a username sudo.

          ( perhaps you can add this line for others users)

          i have only 10 giga so i have to take 50giga more but what is the techniq to change the directory of tiles ( with the new 50 giga, its another partition)



    • Jacquinot Will-Fread
      2 years ago

      Hello, i have a same problem, when i launch my browser: “http://XXXXX/mod_tiles”
      i have:

      NoResp200: 0
      NoResp304: 0
      NoResp404: 0
      NoResp503: 0
      NoResp5XX: 0
      NoRespOther: 0
      NoFreshCache: 0
      NoOldCache: 0
      NoVeryOldCache: 0
      NoFreshRender: 0
      NoOldRender: 0
      NoVeryOldRender: 0
      NoRespZoom00: 0
      NoRespZoom01: 0
      NoRespZoom02: 0
      NoRespZoom03: 0
      NoRespZoom04: 0
      NoRespZoom05: 0
      NoRespZoom06: 0
      NoRespZoom07: 0
      NoRespZoom08: 0
      NoRespZoom09: 0
      NoRespZoom10: 0
      NoRespZoom11: 0
      NoRespZoom12: 0
      NoRespZoom13: 0
      NoRespZoom14: 0
      NoRespZoom15: 0
      NoRespZoom16: 0
      NoRespZoom17: 0
      NoRespZoom18: 0
      NoRespZoom19: 0
      NoRespZoom20: 0
      NoTileBufferReads: 0
      DurationTileBufferReads: 0
      NoTileBufferReadZoom00: 0
      DurationTileBufferReadZoom00: 0
      NoTileBufferReadZoom01: 0

      but when launch:

      i have:

      L’ image “http://XXXXXX/mod_tile/0/0/0.png” ne peut pas être afficher car elle contient des erreurs

      (the image “http: //XXXXXX/mod_tile/0/0/0.png” cannot be displayed because it contains errors)

      Where: XXXXX is my adress ip local

      what can i do?

  • baditaflorin
    6 years ago

    Hi, first of all, thanks for the tutorial, it`s great.

    One question, can you update the tutorial or explain how can we make a self updating OSM tile server so that each day, or each week the map will be updated with the latest changes that appeared in OSM, similar with what OSM site it`s doing now, where if you edit, in 5 minutes you will be able to see the changes.

  • PaulInOttawa
    6 years ago

    Thank-you for your recipe! Unfortunately, I’m still running into frustrations with mod_tile .. I had to apt remove g++ to resolve one set of errors, had to apt install libpixman-1-0 to address a second set of errors, and now ‘make’ in mod_tile is giving me libtool warnings and an error, “cannot find the library ‘/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/pixman/0.32.6/lib/’ or unhandled argument ‘/home/travis/build/mapbox/mason/mason_packages/linux-x86_64/pixman/0.32.6/lib/'”

    No idea who travis is, or why his homedir is hardcoded into a path somewhere 🙂

    Any thoughts on what I might do? Or should I run your recipe from a brand-new 16.04 install and hope for better luck?

    • Xiao Guoan
      6 years ago

      Hi, in the mod_tiles source directory there’s a hidden file named .travis.yml. Maybe you should check it out. And this tutorial is tested on a fresh Ubuntu 16.04 install.

  • Hi, Great tutorial! I was able to load in a small .pbf and serve the tiles to my leaflet viewer. I want to add another .pbf to my server and so I tried just doing the osm2pgsql line of Step-4 again, but with the new .pbf file. However when I restart the server (i.e. reboot the virtualmachine that is running it) I don’t see my knew area on the map, just the original one. Is there something else I need to do to load in new tiles?



    Actually I can see it now. I just had to zoom in and wait for a bit so the renderd service could process the request for the new area I was looking at.

  • I follow your steps, and I got

    renderd.service is not a native service, redirecting to systemd-sysv-install
    Executing /lib/systemd/systemd-sysv-install enable renderd

    when sudo systemctl enable renderd

    did I miss somethings?
    I am new to linux, sorry if I ask stupid question…

    • Xiao Guoan
      6 years ago

      This is normal. Ubuntu 16.04 use Systemd instead of Sysvinit.

  • On my ssh-server, I get

    $ curl

    404 Not Found

    Not Found
    The requested URL /osm-tiles/0/0/0.png was not found on this server.

    Apache/2.4.18 (Ubuntu) Server at Port 80

    The syslog shows that renderd is up and running. /var/lib/mod_tile/ is empty.

  • Thanks! I have made my own osm.
    But there is a problem that I had tried a lot and still not resolved.

    The fonts of Asian region, like China and Japan are squares.
    After searching in google, I found that the problem is about a font, dejavu…
    And I change all three font sets in style.xml

    But still not work.
    Could you help me with this?

  • Fernando Solar
    6 years ago

    Thank you Mr: Gouan, this is the most comprehensive and up to date tutorial i have seen, I think should be published in the OpenStreet site. The instructions there are outdated and truly not anybody is going to install in Ubuntu, but it gives an accurate idea of what it takes to set it up.
    If you let me give you a couple suggestions, i think the swap area setting must come starting step 4, and for the sake of precision, it will be nice to add an instruction to exit osm user at the end of step 6.

    • Xiao Guoan
      6 years ago

      Thanks for the suggestion, Fernando. The tutorial was updated.

  • Pevin Elsenique
    6 years ago

    Hi Mr. Guoan,

    I’m having trouble with this.
    I followed your instructions carefully but still got an error: 404 Not found when accessing it on browser.

    Please help me. Thanks.

    • Xiao Guoan
      6 years ago

      If it’s a 404 error, then you should first check out the Apache error log /var/log/apache2/error.log to find out what caused the error.

      • Pevin Elsenique
        6 years ago

        Thanks for your response.

        It says
        debug: init_storage_backend: initialising file storage backend at: /var/lib/mod_tile

        [Mon Sep 12 18:16:09.150037 2016] [tile:warn] socket connect failed for: /var/run/renderd/renderd.sock with reason: No such file or directory
        [Mon Sep 12 18:16:09.150153 2016] [tile:notice] Failed to connect to renderer

        Checked the /var/run/renderd/ folder and found out that it was empty.

        Tried to remove the semicolon on renderd.sock part of the renderd.conf, but still got the same error.

        Really appreciate your help.

        • Pevin Elsenique
          6 years ago

          I’m sorry but I still got the same error.

        • Michi Scholz
          6 years ago

          I had the same problem. After investigating I found out that after the installation of mod_tile, its shared libraries were not yet registered correctly to the system. Run “sudo service renderd status” to check what is going wrong and also take a look into /var/log/syslog. In my case was not found by renderd. Simply running “sudo ldconfig” fixed it. After restarting renderd via “sudo service renderd restart” the error disappeared and everything was working as expected.

        • Jason Purkiss
          4 years ago

          OMG that worked, thanks mate been stuck on the for a few hours 🙂

        • Jason Purkiss
          4 years ago

          message to self for when i find my self here again as i just did, it is a L jason not an I in ldconfig 🙂

  • Hello,
    Great page. Helped lot. I have one question. I installed by your steps and it works good. what If i wanna use different map style. How can i change map style without import all data again? thank you.

  • Slah Lachtar
    6 years ago

    followed your tutorial and was able to install my tile server nickel, thank you very much.
    I wonder if I can install gisgraphy along with the tile server, because I need geocoding and reverse gecocoding services.
    I found this tutorial
    but I wonder if it’s valid for Ubuntu 16.
    Any advice on how to proceed since tile server is already in production.

    Thank you again

  • Dennis Bauszus
    6 years ago

    Loving the tutorial. Unfortunately I wasn’t able to get this working. 🙁 Any tile request create following debug note in the apache errorlog. debug: init_storage_backend: initialising file storage backend at: /var/lib/mod_tile
    I get a 404 when I request the test tile. The requested URL /osm_tiles/0/0/0.png was not found on this server.

    • Dennis Bauszus
      6 years ago

      Sorry… I had something misspelled. Got it working straight away after redoing the tutorial.

  • Rabeeh Vc
    6 years ago

    Hello Mr Guoan , first of all appreciating your work . its fantastic , helpful . But one question , that is : if i add a country extract as map data , then if it possible to add the whole planet later by overwriting the country extract map data in the postgreSQL database .

  • Dennis Bauszus
    6 years ago

    I redid your tutorial and did a writeup myself.
    Thanks so much for breaking ground on Ubuntu 16.04… One question though. I was not able to have renderd starting when I reboot my server. Is this working for you? Do you have any ideas what I might have done wrong.

    • Xiao Guo-An (Admin)
      6 years ago

      I encountered the same problem before I wrote this tutorial. I fixed it, however I don’t remember what exactly caused this problem. I think you should check out your system log to see what is wrong.

  • Daniel Snider
    4 years ago

    I made it way EASIER to create a local tileserver! Just use my docker image:

  • Hello Mr Guoan,
    Thank a lot for this tutorial …it was very helpful….

  • Hii Mr. Guoan, what a great tutorial! Thx
    I follow qll the steps qnd my own server osm worksm but my question would be this:
    how i do to access to the map from another computer? when i do this i only get the frame and no map!
    Plz help

  • What a great tutorial. People i have a Problem. He is so slow, what can that be?

  • Sleep Fate
    4 years ago

    Great and simple tutorial that works !
    Can i render png-tile-files in home dir for furher work ?
    Command _render_list_ do render meta files, not png.

  • alice yang
    4 years ago

    Hi Mr. Guoan,
    I followed this tutorial throughly and came to end as all goes well.
    But as u said your-server-ip/osm_tiles/0/0/0.png
    when i am looking for map in web browser like localhost/osm_tiles/0/0/0.png, i m getting nothing.
    could not find the directory there. need help

    • Same problem. I realized that I had a typo when I was writing the configuration files. I recommend you to check the status of renderd.

  • Ani Ahmetaj
    4 years ago

    Thank you for your tutorial!

    Unfortunately I am having a problem where renderd I guess does not create the osm_files directory. I don’t know why, but I get a “Not Found” error when I check localhost/osm_tiles/0/0/0.png

    I have a world map download on an Azure VM with 16cores, 112GB of RAM and 1TB of SSD disk space.

    You can check it at

    Can you please offer some help? Or should I try with smaller maps? I got the same problem when I tried with the map of Albania for the first time and thought that maybe the map was incomplete or something, I don’t even know… But I keep getting the same issue with the global map so…

    Please help!

    Btw, Happy New Year 2018

  • Ger Groeneveld
    4 years ago

    for the mapnik part in step 5 see Given installation method doesn’t work for Ubuntu 16.04 (no libmapnik-dev dependencies in xenial anymore)

  • Gareth Johnstone
    4 years ago

    how would one update the tile server using the osm.pbf files?

    All the tutorials seems to stray away from the way that it was built in this tutorial.

    • Corner Monkey
      4 years ago

      I have this same question, Gareth. When I went through this tutorial, I only used one state’s osm.pbf file and had no issues rendering a map for that state. When I went back through step 4 of the tutorial to import map data from a second state into PostgreSQL, I was unable to render a map for that state. There has to be a way to update or import additional maps?

  • zelazko
    4 years ago

    Is it possible to generate data in another EPSG eg 2180: EPSG? If in style, change srs to +proj=tmerc +lat_0=0 +lon_0=19 +k=0.9993 +x_0=500000 +y_0=-5300000 +ellps=GRS80 +units=m +no_defs, renderd return “Unknown projection string, using web mercator as never the less”. I’m using tutorial from swich2osm fro ubuntu 16.04.
    Greetings from Poland.

  • jackmiemie
    4 years ago

    Hi, this is a great tutorial ! It saves my life.
    But I found an issue of rendering Chinese character on the map. All the Chinese characters are displayed as blank squares. How can I fix this issue ?

  • Sam Fayad (Seam)
    4 years ago

    Great tutorial, worked from 1st run!
    i wonder if there’s a way to modify the style the tiles are rendered with, and if so what is the process to follow? are there any samples that can be tried?
    Thanks a lot 🙂

  • Thanks. Great!


    how to create subdomains to speed up

  • Really appreciate sir ,
    At the step

     carto project.mml > style.xml 

    I have following problem

       TypeError: Cannot read property 'hasOwnProperty' of undefined
        at Object.ref.setVersion (/usr/lib/nodejs/carto/lib/carto/tree/reference.js:19:34)
        at /usr/lib/nodejs/carto/lib/carto/tree/reference.js:209:5
        at Object. (/usr/lib/nodejs/carto/lib/carto/tree/reference.js:213:3)
        at Module._compile (module.js:652:30)
        at Object.Module._extensions..js (module.js:663:10)
        at Module.load (module.js:565:32)
        at tryModuleLoad (module.js:505:12)
        at Function.Module._load (module.js:497:3)
        at Module.require (module.js:596:17)
        at require (internal/module.js:11:18)

    Would you mind helping me please?
    Thanks in advance

  • @sepehr

  • Bryan Tayler
    4 years ago

    Hi man,
    great tutorial thanks a lot.
    i have a question did you make any tutorial on how i can make a vector tile server?
    thank you in advance.

  • Hi. Can you say to me how to compile this styles for osm server?

  • Hello,it works great. but i failed to install on ubuntu 18. Can you also guide us about it?
    Thank you.

    • liahimn
      3 years ago

  • ThoMMse
    3 years ago

    With this great tutorial it was possible to run an own OSM server.
    After the update from Ubuntu 16.04 to 18.04 the rendering process was not working anymore with the following error: socket connect failed for: /var/run/renderd/renderd.sock
    Any experiences with this effect?

    Thanks in advance.

  • SpamAuditor
    3 years ago

    Reminder, given the recent compromises, you should include adding a firewall/iptables entry so that postgres is NOT open to the internet.

    • Thanks for your suggestion about firewall. By default, PostgreSQL listens on the localhost only.

      • Jacquinot Will-Fread
        2 years ago

        Hello Mr Guoan, what shoud i do if i have this:

        the image “http: //XXXXXX/mod_tile/0/0/0.png” cannot be displayed because it contains errors


  • Hi
    Thank you very much for a very simple and comprehensive tutorial.
    Is there any leads on how to make the server auto update?
    How do i automate the DB imports so that i can run the render_list function again?

    I’m going to use it on a small country (not entire world), so it is around 300-400mb download of mapdata. (no need of satellite images)


  • Shatrughan Saxena
    3 years ago


    I am trying to build maps of India along with disputed boundaries. I tried many links and suggestions but nothing is working for me. Can you please help me.

  • gajanan
    2 years ago

    There no osm_tiles folder in /var/www/html/ path
    that’s why I’m not getting map when I enter http: //XXXXXX/mod_tile/0/0/0.png this in url.
    please provide some solution for this

  • rajabzadeh
    2 years ago

    is it necessary to craete user osm 😕
    can i do it with my default user?

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community ( for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here