diff --git a/.flake8 b/.flake8
new file mode 100644
index 0000000000000000000000000000000000000000..a9b2cc982e715d8012b642b69071d67b1dc8123b
--- /dev/null
+++ b/.flake8
@@ -0,0 +1,4 @@
+[flake8]
+# E501: let black handle line length
+# W503 is incompatible with PEP 8
+ignore = E501,W503
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 87875d25ac11bc56abc6ef708995d9588054d505..c11fcdef1b2ff9b140a15c57a8cbe1649430e456 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,11 +1,15 @@
 image: docker:latest
+include:
+  - "https://gitlab.esss.lu.se/ics-infrastructure/gitlab-ci-yml/raw/master/PreCommit.gitlab-ci.yml"
 
 variables:
   NGINX_IMAGE: "$CI_REGISTRY_IMAGE/nginx"
   PYTHON_SERVER_IMAGE: "$CI_REGISTRY_IMAGE/python-server"
 
 stages:
+  - check
   - build
+  - test
   - release
   - deploy
 
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..c87086f8d66d10ed173548e74e88403c7311d61d
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,9 @@
+repos:
+  - repo: https://github.com/ambv/black
+    rev: 19.10b0
+    hooks:
+      - id: black
+  - repo: https://github.com/pre-commit/pre-commit-hooks
+    rev: v2.4.0
+    hooks:
+      - id: flake8
diff --git a/README.md b/README.md
index 9e4268594d995f859fd17d652df1a9e37f23fd86..917e62208b1c7df49764a4265a216048d62703dd 100644
--- a/README.md
+++ b/README.md
@@ -8,6 +8,13 @@ This repository contains the structure to create the public opi screens running
 If you want to contribute to the screens the sequence is the following:
 
 - Install Docker on your computer and clone the git archive
+- Install pre-commit: https://pre-commit.com
+- Install the git hook scripts (only required the first time you clone the repo):
+
+  ```
+  pre-commit install
+  ```
+
 - Build the docker images with
 ```
 docker-compose build