Jun 11 2012

CartoDB (version 1) : EC2 AMI & vmdk VM available

Category: cartographie,cartography

CartoDB is a beautiful beast but it takes some time to get all its components ( 1 rails app, 2 nodejs apps, postgis, redis, varnish, mapnik, nginx … ) to work in harmony. Assembling it was an interesting odyssey though which pushed me to read cartodb’s ruby & javascript source code (Windshaft & CartoDB-sql-api ) itself to get things rolling.  To avoid this constructive pain to others I am proposing two ubuntu distributions with CartoDB (version 1) pre-installed .


An Amazon EC2 AMI: https://aws.amazon.com/amis/cartodb-ubuntu11-10-server

system : ubuntu server 11.10 x86 64 bit

user : ubuntu
authentication : instance ssh keypair


  • open ports 22, 80, 8080, 8181 (optionally 8282 )  in your instance security group
  • point devuser.localhost.lan & admin.localhost.lan to the IP of the instance in your hosts file (on your machine, not on the AMI)

( 22: ssh, 80 : varnish, 8080 : cartodb sql api,
8181 : windshaft tileserver, 8282:  rails cartodb app)

remote access via freenx :  ubuntu / ubuntu

CartoDB urls : http://devuser.localhost.lan (user/password: devuser/devuser) , http://admin.localhost.lan (user/password: admin/admin)



Try it free during one year on a Amazon Free Usage Tier Micro Instance  : http://aws.amazon.com/en/free/


A vmware vmdk Virtual Machine :  https://docs.google.com/folder/d/0B7MWSdtS_8wWTjg5YmNHeDdIRUU/edit for download


system : ubuntu server 11.10 x86 64 bit
user : cartodb
password: cartodb

ports: all open
connection : ssh , freenx ( user/password : cartodb/cartodb)

The vmware VM is configured with a static IP ( so you if you use vmware/vmplayer you need to run the Virtual Network Editor and change the NAT interface ( in my case VMnet8 ) to use as Subnet IP . On Windows get the Virtual Network Editor vmnetcfg.exe using following
instructions : http://rednectar.net/2011/07/20/finding-vmnetcfg-exe-in-vmware-player-3-1-4/
or http://communities.vmware.com/message/1853079

CartoDB urls : http://devuser.localhost.lan (user/password: devuser/devuser) , http://admin.localhost.lan (user/password: admin/admin)




freenx session configuration  (Nomachine NX client , openNX ) :


use Unix custom settings :

– Run the following command :
exec openbox-session
– New virtual desktop












 CartoDB is a Vizzuality open source online mapping application based on postgis.

Share and Enjoy:
  • Print
  • Digg
  • StumbleUpon
  • del.icio.us
  • Facebook
  • Twitter
  • Google Bookmarks
  • BlinkList
  • Reddit
  • Suggest to Techmeme via Twitter
  • Technorati

Related Posts:

  • No Related Posts

Tags: , , , , ,

24 Responses to “CartoDB (version 1) : EC2 AMI & vmdk VM available”

  1. Craig says:


    Thank you for the image and tutorial, much help. I tried to use the api /api/v1/?sql=select… but was unable to get it working.

    Is it already installed on the image? If you could offer any advice I would be very grateful.


  2. Loïc says:

    Hi Craig, did you try to hit the cartodb sql api on port 8080 ?

  3. Chris says:

    Thanks a lot for this AMI. Awesome. Can you tell me how I can “point devuser.localhost.lan & admin.localhost.lan to the IP of the instance in your hosts file (on your machine, not on the AMI)”?
    Thanks a lot in advance!

  4. Loïc says:

    Hi Chris,

    just edit the host file on the machine your are using to access CartoDB so devuser.localhost.lan and admin.localhost.lan resolves to the IP of your Cartodb AMI instance.
    On linux : http://linux.about.com/od/commands/l/blcmdl5_hosts.htm
    Windows: http://helpdeskgeek.com/windows-7/windows-7-hosts-file/


  5. Bobby says:

    Thanks for making this!

    With apologies, I’m a bit lost on the rar step, however. If I’m trying to unrar these three files from a command line, what do I do to get them merged correctly? (Simply doing “unrar e” on each file individually results in a bunch of questions about redundancy, which leads me to believe that I’m not doing this right.)

    Thanks again!

    – Bobby

  6. Loïc says:

    Hi Bobby,

    did you try : unrar x ubuntu-11.10-64bit-CartoDB-vmdk.part01.rar ?


  7. Bobby says:


    It looks like this is booting up nicely now on VirtualBox (since I’m on a mac).

    Skating on the edge of an unreasonable request: Would you be able to post md5 hashes at your leisure for the decompressed vmdk, nvram, etc? That will allow me to be doubly sure I have the full images.

    Either way, thanks again for this great resource.

    – Bobby

  8. Loïc says:

    Unfortunately I can’t produce the hashes from the original files because I created the vm on a virtual server ( http://www.elastichosts.com/ ) and erased the instance once I had the job done . If you managed to unrar the files without errors then there is a good chance that your files are correct thanks to Rar’s CRC mechanism .
    I’ll try not to forget to publish hashes for the Cartodb 2.0 vm .


  9. mortimer says:


    I am trying to run this in a virtual machine locally on my computer. It mostly work, but sometime at loggin, and then when going to the account settings or uploading data, I get redirected to port 4000. Which doesn’t seem to be bound to anything in the netstat table.
    Any clue?


  10. Loïc says:

    You might look for “4000” in the cartodb rails code https://github.com/Vizzuality/cartodb . It’s probably set in some configuration file or hard coded.

  11. Z.S. says:

    I have started the AMI instance and get cartodb running. But when I tried to create a new table by importing a file from my local machine, I got this error:

    Oops! There has been an error
    Code 99999
    TRANSITION: preprocessing => uploading, 2012-10-04 01:11:33 +0000
    getaddrinfo: Name or service not known
    Table error, #

    Please help!


  12. Loïc says:

    can you try to create a table manually, export it as a shape file and import the same file in your cartodb instance ? If the error doesn’t occur then the problem might be related to your specific shapefile and we will have to investigate further. Also does your server resolve domain names correctly ( try a ping to a domain name) ?

  13. Z.S. says:

    Thanks fore reply!
    First, I sshed into the instance and pinged google.com successfully.
    Then, I dumped the pre-installed table to kmz file and tried to uploaded it. I got the same error. Here is what showed in the log when I did that: – – [04/Oct/2012:08:18:34 +0000] “POST /upload?qqfile=test.kmz HTTP/1.1” 413 600 “http://devuser.localhost.lan/dashboard” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4” – – [04/Oct/2012:08:18:35 +0000] “POST /api/v1/tables/ HTTP/1.1” 400 247 “http://devuser.localhost.lan/dashboard” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4”

    Can you see anything wrong?
    Also, I found that the share map functionality also did not work. I did open the 8181 port, because I can access http://devuser.localhost.lan:8181/.

    Thanks for your help

  14. Z.S. says:

    Please ignore my previous comment. I have fixed it. Here is how:
    I found the error message in the cartodb.error.log is : client intended to send too large body. So I changed the client_max_body_size setting in nginx.conf and the problem solved.

    But I still have problems with sharing the map. As I mentioned before, I did open the 8181 port, because I can access http://devuser.localhost.lan:8181/. But when I use the share link http://devuser.localhost.lan:8181/tables/pais_eco_natiucn_esp/embed_map to access it, I got “Cannot GET /tables/pais_eco_natiucn_esp/embed_map”

    Thanks for your help

  15. Loïc says:

    Well done and thanks for the feedback. For the sharing option , remove 8181 in the url and you should be okay.

  16. Peter says:

    I have set up the AMI such that I access the login page with my public ec2 dns:

    however, upon entering admin/admin or user/user i am redirected to http://localhost.lan:4000/login which can’t be located.

    i have added the following to my /etc/hosts file:

    ec2-.us-west-1.compute.amazonaws.com devuser.localhost.lan
    ec2-.us-west-1.compute.amazonaws.com admin.localhost.lan

    but when i enter http://devuser.localhost into the browser :
    Oops! Google Chrome could not find devuser.localhost.lan

    Id appreciate any suggestions. My local machine is OSX. Thanks for creating the AMI, I’m hopeful that it will work out.

    best regards,


  17. Loïc says:

    You did not configure your host file correctly. You should use an IP address ( ) instead of ec2-184-169-189-34.us-west-1.compute.amazonaws.com .

  18. MArco says:

    Hi Loïc,
    thank you very much for your hard work! Do you plan also to update the AMI and the virtual machine to the new CartoDB 2.0 that will be online from tomorrow?

    Best regards

  19. Marco says:

    I setup everything and works fine, but the only problem is the access to the account setting of the user: it will point me to localhost.lan:4000/account but I see that there aren’t anything on that port. I tried to remove the port from the app_config.yml but i can’t resolve the route /account/username
    Do you have any working configuration for that?

  20. Loïc says:

    No plans yet but if I find the time I would love to create an AMI for Cartodb 2.

  21. Loïc says:

    I think the user management code is not provided in the cartodb source code. It is tightly linked to their billing system I think so they didn’t include it.

  22. Jay says:

    awwwweeesome! after a month of trying to build cartodb from source Finally i can start working on my final yr project 😀 😀 THANK YOU VERRY MUCH !

  23. Loïc says:

    Great, what is your project about ?

  24. Jay says:

    Its a web mapping application that visualizes food prices of Africa on a interactive map & with lots of other complex functionalities.

Leave a Reply