diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index cd175475fe312887cd96cf081eaaf2f5d38ca6ed..6727fffd8cc23825679a20918a44a84f537875ff 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -8,4 +8,4 @@ add_custom_target(python ALL
     COMMAND python3 setup.py build
     DEPENDS opendht opendht_cpp.pxd opendht.pyx)
 
-install(CODE "execute_process(COMMAND python3 setup.py install WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
+install(CODE "execute_process(COMMAND python3 setup.py install --root=\$ENV{DESTDIR}/ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})")
diff --git a/python/Makefile.am b/python/Makefile.am
index 23398e0dbb963273e86d2f714affd16d2ae6b6bd..232aaaac5378ad2f8190bb5c309e99c7eac12f6a 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -13,7 +13,7 @@ clean-local:
 	rm -rf $(builddir)/build $(builddir)/*.so $(PYTHON_INSTALL_RECORD)
 
 install-exec-local:
-	$(PYTHON) setup.py install --record $(PYTHON_INSTALL_RECORD)
+	$(PYTHON) setup.py install --root=$(DESTDIR) --record $(PYTHON_INSTALL_RECORD)
 	rm -rf $(builddir)/build
 
 if HAVE_PIP
diff --git a/python/setup.py.in b/python/setup.py.in
index c4654d3ed1bba17636e7b29968650dc1a6f04a61..b2d94c22c0e682d997535255df7c01469208fc44 100644
--- a/python/setup.py.in
+++ b/python/setup.py.in
@@ -1,4 +1,4 @@
-# Copyright (C) 2015-2016 Savoir-faire Linux Inc. 
+# Copyright (C) 2015-2016 Savoir-faire Linux Inc.
 # Author: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>
 # Author: Adrien Béraud <adrien.beraud@savoirfairelinux.com>
 #