title: Installing and upgrading help Data directory (/var/www/moodledata) cannot be created by the installer
body: <p>I'm trying to deploy Moodle into Docker.</p>
  
  <p>Here is the steps I followed:</p>
  
  <p>First, create a new network for the application and the database: </p>
  
  <pre><code>$ docker network create moodle
  </code></pre>
  
  <p>Then, start a new database process in an isolated container: </p>
  
  <pre><code>$ docker run --name mysql --network moodle -e MYSQL_ROOT_PASSWORD=password -d mysql
  </code></pre>
  
  <p>Finally, you can run this moodle image and link it to your mysql container: </p>
  
  <pre><code>$ docker run --name my-moodle --network moodle --link mysql:database -p 8080:80 -d aesr/moodle
  </code></pre>
  
  <p>Access it via <code>http://localhost:8080</code> or <code>http://host-ip:8080</code> in a browser.</p>
  
  <p>But while installing moodle I'm getting this error: </p>
  
  <blockquote>
    <p>Data directory (/var/www/moodledata) cannot be created by the installer.</p>
  </blockquote>
  
  <p>Maybe because of Apache doesn't have the proper permission. I'm running Docker on Windows.</p>