diff --git a/Snakefile b/Snakefile
index 86a6259825140c31904b57e7809827eefecb5f39..20367055f16d2b4c455e0eb93d22c8cf02992db6 100644
--- a/Snakefile
+++ b/Snakefile
@@ -4,6 +4,7 @@ import gzip
 import json
 import bz2
 from copy import deepcopy
+import subprocess
 
 
 def dict_merge(a, b):
@@ -82,6 +83,27 @@ def prepare_environment(stepname):
     return out, os.path.join(out, '%s.log' % stepname)
 
 
+def symlink_prokka():
+    # ## prokka by default will look databases where is located the binary.
+    # ## we have to softlink to put the binary somewhere and the databases somewhere else.
+    cmd = """
+    if [[ "{DBPATH}" = /* ]]
+    then
+        PP={DBPATH};
+    else
+        PP=$PWD/{DBPATH};
+    fi
+    DD=$(dirname $(which prokka))/../db
+    if [[ ! -L $DD ]]
+    then
+        echo "Softlinking $DD to $PP"
+        cd $(dirname $(which prokka))/.. && ln -s $PP db
+    fi
+    """
+    shell(cmd)
+
+symlink_prokka()
+
 # INCLUDES RULES
 include:
     "rules/Util.rules"
diff --git a/rules/Util.rules b/rules/Util.rules
index 71c2cdb997abc00c69ce788353e441a5c0d1105b..d77387fc4352c6eab4146c27c1d2eee6d0a25c0d 100644
--- a/rules/Util.rules
+++ b/rules/Util.rules
@@ -55,6 +55,7 @@ rule _DOWNLOAD_PROKKA_DATABASES:
         """
 
 
+
 rule _DOWNLOAD_TRIMMOMATIC_ADAPTERS:
     output:
         "{DBPATH}/adapters/adapters.done"