diff --git a/backend/entrypoint.sh b/backend/entrypoint.sh
index e8eceafd487defc13160f585edaaa6d1c20b0efe..ff943eb2d2e1c0b2e4589b916db487a88b384f70 100755
--- a/backend/entrypoint.sh
+++ b/backend/entrypoint.sh
@@ -2,6 +2,23 @@
 export PYTHONUNBUFFERED=TRUE
 export PYTHONFAULTHANDLER=1
 mkdir -p /logs
+if [ -n "$SECRET_KEY" ]
+then
+    echo "Use env SECRET_KEY"
+else 
+    if [ -f /logs/secret.key ]
+    then
+        echo "Use existing secret.key"
+        SECRET_KEY=`cat /logs/secret.key`
+        export SECRET_KEY=$SECRET_KEY
+    else
+        echo "Create new secret.key"
+        SECRET_KEY=$(python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())')
+        echo $SECRET_KEY > /logs/secret.key
+        export SECRET_KEY=$SECRET_KEY
+    fi
+fi
+
 python image_similarity/main.py 2>&1 | tee /logs/gunicorn_image_similarity.log &
 python manage.py showmigrations | tee /logs/show_migrate.log
 python manage.py migrate | tee /logs/command_migrate.log
diff --git a/librephotos.env b/librephotos.env
index 0486e0f457000a79a7e0e36a9674fb305fe6ad2a..11c0c2d86f94590a0f822fbaaa1364a5fd93200f 100644
--- a/librephotos.env
+++ b/librephotos.env
@@ -10,9 +10,6 @@ myPhotos=./librephotos/pictures
 # Internal data of LibrePhotos
 data=./librephotos/data
 
-# Secret Key. Get one here https://rb.gy/emgmwo (Shortened random.org link)
-shhhhKey=D2VymuMn2gAhx4tmAawd
-
 # ------------------------------------------------------------------------------------------------
 
 # Wow, we are at the optional now. Pretty easy so far. You do not have to change any of the below. 
@@ -21,7 +18,7 @@ shhhhKey=D2VymuMn2gAhx4tmAawd
 httpPort=3000
 
 # What branch should we install the latest weekly build or the development branch (dev)
-tag=latest
+tag=dev
 
 # Number of workers, which take care of the request to the api. This setting can dramatically affect the ram usage.
 # A positive integer generally in the 2-4 x $(NUM_CORES) range.