Answers: <p>The only issue you might have running the same services in containers as locally on your machine is a port conflict. Let's take httpd as an example:</p>
  <ul>
  <li>You try and start the container and you get <code>listen tcp 0.0.0.0:80: bind: address already in use</code>. This is because a HTTP server is already running on your machine.</li>
  <li>Tell docker to bring the container up using a different local port: <code>docker run -p 80:8080 &lt;your container, commands etc&gt;</code>. This will tell Docker to bind port <code>80</code> in the container to port <code>8080</code> on your machine.</li>
  <li>You can now access both <code>http://localhost:80</code> (your machine) and <code>http://localhost:8080</code> (the container).</li>
  </ul>
  
Answers: CC BY-SA 4.0
Answers: 2021-07-22T03:40:42.440Z
Answers: will there be a conflct with mysql and php command in terminal ?
Answers: Padawan
Answers: CC BY-SA 4.0
Answers: 2021-07-21T10:16:17.957Z
Answers: 2021-07-21T10:16:17.957Z
Answers: Matthew Hodgkins
Body: <p>I have installed MySQL and apache using brew on my local machine and have been using them for several php project environments. Now i want to start learning docker to containerize a new Laravel environment (<a href="https://laradock.io" rel="nofollow noreferrer">example</a>) . Before i start using docker on my local machine, should i stop the httpd and mysql service ? will the 'php' and 'mysql' command have a conflict ?</p>
  
Tags: <docker>
Title: Should i stop native apache and mysql when running docker?
UserDisplayName: Padawan
ThreadText: # Should i stop native apache and mysql when running docker?
  
  (Asked by: username_0 on 2021-07-21)
  
  I have installed MySQL and apache using brew on my local machine and have been using them for several php project environments. Now i want to start learning docker to containerize a new Laravel environment ([example](https://laradock.io)) . Before i start using docker on my local machine, should i stop the httpd and mysql service ? will the 'php' and 'mysql' command have a conflict ?
  
  **Tags:** docker
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-07-21. Score: 1
  
  The only issue you might have running the same services in containers as locally on your machine is a port conflict. Let's take httpd as an example:
  
  * You try and start the container and you get `listen tcp 0.0.0.0:80: bind: address already in use`. This is because a HTTP server is already running on your machine.
  * Tell docker to bring the container up using a different local port: `docker run -p 80:8080 <your container, commands etc>`. This will tell Docker to bind port `80` in the container to port `8080` on your machine.
  * You can now access both `http://localhost:80` (your machine) and `http://localhost:8080` (the container).
  
  > **Comments:**
  > **username_0**: will there be a conflct with mysql and php command in terminal ?  
  
  ---
  
  