Install mitmproxy on Ubuntu

mitmproxy is a man in the middle proxy server for debugging.


To install mitmproxy on Ubuntu, run

sudo apt install mitmproxy -y

On Ubuntu 18.04, this is broken. To insall i created a virtualenv

mkdir -p  ~/www/mitmproxy
cd ~/www/mitmproxy
virtualenv --python=/usr/bin/python3 venv
source venv/bin/activate

Install mitmproxy inside virtualenv with

pip install mitmproxy

To start, run


This will listen proxy on port 8080, you can verify with command

netstat -lntp

If you get error like

boby@sok-01:~$ /home/boby/www/mitmproxy/venv/bin/mitmproxy
Error: mitmproxy requires a UTF console environment.
Set your LANG environment variable to something like en_US.UTF-8


export LANG=en_US.UTF-8

To configure in browser, you can use it as HTTP proxy. Here is how i configure it on Firefox FoxyProxy.

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published. Required fields are marked *