diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2c3a1314800e59d4f1eaeac2a957bf97c27fea48..508ab4f65f04d8f3c34d642f69cc277a6813ff08 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,7 @@ variables:
 stages:
   - build_docker
   - testing
+  - release
 
 build_docker_from_scratch:
   only:
@@ -31,10 +32,12 @@ build_docker_from_cache:
     - docker build -t $CONTAINER_TEST_IMAGE .
     - docker push $CONTAINER_TEST_IMAGE
 
+before_script:
+  - pip3 install --user .
+
 mytest:
   stage: testing
   script:
-    - pip3 install .
     - pytest-3 -q --cov=resolve test
   coverage: '/^TOTAL.+?(\d+\%)$/'
 
@@ -43,10 +46,17 @@ test_mpi:
   variables:
     OMPI_MCA_btl_vader_single_copy_mechanism: none
   script:
-    - pip3 install .
     - mpiexec -n 2 --bind-to none pytest-3 -q test/test_mpi
 
-# staticchecks:
-#   stage: testing
-#   script:
-#     - flake8 .
+pages:
+  stage: release
+  script:
+    - rm -rf docs/build docs/source/mod
+    - sh docs/generate.sh
+    - mv docs/build public
+  artifacts:
+    paths:
+      - public
+#  only:
+#    - master
+
diff --git a/Dockerfile b/Dockerfile
index 49c98916ba192c15fa86f3dbc439c536d04c2b2c..fca7159839c896bbb2a7d794fd0b8f2e7f7be660 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,7 +13,8 @@ RUN pip3 install astropy
 RUN apt-get install -qq python3-mpi4py
 # Testing dependencies
 RUN apt-get install -qq python3-pytest-cov
-RUN pip3 install flake8
+# Documentation dependencies
+RUN apt-get install -qq python3-sphinx-rtd-theme
 
 # Create user (openmpi does not like to be run as root)
 RUN useradd -ms /bin/bash testinguser
diff --git a/docs/generate.sh b/docs/generate.sh
new file mode 100755
index 0000000000000000000000000000000000000000..12eb53a4ad803631c4c49d30ca9cf8b4b46d06e4
--- /dev/null
+++ b/docs/generate.sh
@@ -0,0 +1,2 @@
+sphinx-apidoc -e -o docs/source/mod resolve
+sphinx-build -b html docs/source/ docs/build/
diff --git a/docs/source/conf.py b/docs/source/conf.py
new file mode 100644
index 0000000000000000000000000000000000000000..e4563b2c452c2f9ae1bbd67f88a8fa86827cbdd5
--- /dev/null
+++ b/docs/source/conf.py
@@ -0,0 +1,27 @@
+extensions = [
+    'sphinx.ext.napoleon',  # Support for NumPy and Google style docstrings
+    'sphinx.ext.imgmath',  # Render math as images
+    'sphinx.ext.viewcode'  # Add links to highlighted source code
+]
+master_doc = 'index'
+
+napoleon_google_docstring = False
+napoleon_numpy_docstring = True
+napoleon_use_ivar = True
+napoleon_use_admonition_for_notes = True
+napoleon_use_admonition_for_examples = True
+napoleon_use_admonition_for_references = True
+napoleon_include_special_with_doc = True
+
+project = u'resolve'
+copyright = u'2019-2021, Max-Planck-Society'
+author = u'Philipp Arras'
+
+# FIXME release = resolve.version.__version__
+# FIXME version = release[:-2]
+
+language = None
+exclude_patterns = []
+add_module_names = False
+
+html_theme = "sphinx_rtd_theme"
diff --git a/docs/source/index.rst b/docs/source/index.rst
new file mode 100644
index 0000000000000000000000000000000000000000..dcfbb0f9f43a570e55d8872841fc69a4187aacba
--- /dev/null
+++ b/docs/source/index.rst
@@ -0,0 +1,17 @@
+Resolve
+=======
+
+Resolve is a Bayesian radio imaging algorithm.
+
+References
+----------
+
+FIXME
+
+Contents
+........
+
+.. toctree::
+   :maxdepth: 2
+
+   Package Documentation <mod/resolve>