We are hosting a cartodb installation ourselves which works pretty well but I can't seem to figure out how to get cartodb.js to call our installation instead of the one at cartodb.com.

Reading the source it's clear that cartodb.com is the default host so it should be possible to somehow specify another host.

The end goal is to build the maps programmatically using cartodb.js and the sql api (if that makes a difference).

1 Answer 1


If you want to use SQL API from cartodb.js pointing to a different server you can use some options in cartodb.SQL:

var sql = cartodb.SQL({ user: 'youruser', host: 'host.com', protocol: 'http' })
  sql.execute('select * from table', function(data) {

The interesting code is here: https://github.com/CartoDB/cartodb.js/blob/develop/src/api/sql.js#L33


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.