diff --git a/Dockerfile b/Dockerfile
index 8f96d7074b394b673e90622c29b0fc0bf2ccba53..0c50bca306f8f601325513808bab2f8e23cbef1b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -35,16 +35,19 @@ COPY crontab /etc/cron.d/backup
 RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
 
 # Create /papermc and /backup directories and /web for the dynmap
+RUN mkdir /papermc /backup /web
 
 #sets permission for the cronjobs
 RUN chmod 0644 /etc/cron.d/backup
 #starts the service for cron
 
 
-# Add papermc user and group
+# Add papermc user and group, then change ownership of /papermc and /backup to this user
 RUN groupadd -g ${GUID} ${papermc_group} 
 RUN useradd -g ${GUID} -l -M -s /bin/false -u ${GUID} ${papermc_user} 
-
+RUN chown -R ${GUID} /papermc/ 
+RUN chown -R ${GUID} /backup/
+RUN chown -R ${GUID} /web/
 
 # Get package lists, install needed packages, then remove the package lists again (to save space)
 # "webp" is needed to generate images with better compression for the dynamic map (optional, needs further configuration in dynmap-plugin´s config file)
@@ -63,10 +66,6 @@ RUN apt-get update && apt-get install -y \
 # Execute all following commands as the papermc user
 USER $papermc_user
 
-#create directorys after switching user to avaid permission problems
-
-RUN mkdir /papermc /backup /web
-
 # Start script and also entrypoint for the container
 CMD ["sh", "/papermc.sh"]