Install your own IPlookup tool

1 minute read

When you want to know your public IP address, you will probably use a tool like

However if we don’t want to rely entirely on an external service and we don’t feel like giving our IP address to unknown strangers we might want to self-host.

To do this we use echoip, a self-hosted IP lookup solution written in Go.


We use the docker container provided by echoip’s maintainer to deploy the tool. Here is our docker-compose file :

version: '2'
    container_name: 'echoip'
    image: 'mpolden/echoip:latest'
    restart: unless-stopped
      - '8085:8080'

Now we just have to start it with docker-compose up -d. Of course, we need Docker and docker-compose installed for it to work.

Nginx config

Now we want to serve our service through To do so we configure our subdomain with our domain provider and configure Nginx with a reverse proxy.

Here is the Nginx configuration in the file /etc/nginx/sites-available/

server {
    listen *:80;

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;

We then deploy a certificate for this subdomain with Let’s Encrypt

sudo certbot --nginx -d -d

And finally we can activate the site :

sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled
sudo nginx reload