diff --git a/tox.ini b/tox.ini
index c6d978b969712b148cd9bbe602ecf385eff690c7..64c674b9078d1b31e048b9320d638ae7415a2cd4 100644
--- a/tox.ini
+++ b/tox.ini
@@ -7,9 +7,12 @@ envlist = py37,py38
 whitelist_externals = poetry
 skip_install = true
 envdir = {toxworkdir}/globalenv
-commands_pre = ./dev.sh install-all
+commands_pre =
+     - sudo apt update
+     - sudo apt install python3-ldap libldap2-dev libssl-dev libsasl2-dev python3.7-dev -y
+     - ./dev.sh install-all
 commands =
-    poetry run pytest --cov=. {posargs} aleksis/ apps/official/
+    - poetry run pytest --cov=. {posargs} aleksis/ apps/official/
 
 [testenv:selenium]
 setenv =