Answers.Body: <p>At the risk of offering a "link answer", the <a href="https://nystudio107.com/blog/setting-up-a-craft-cms-3-project" rel="nofollow noreferrer">Setting up a New Craft CMS 3 Project</a> has a section on <strong>DEPLOYING CRAFT CMS</strong> that should be useful to you.</p>
  
  <p>I've never heard of Rocketeer, but popular ways to handle deployments are via <a href="http://buddy.works/" rel="nofollow noreferrer">buddy.works</a>, <a href="https://forge.laravel.com/" rel="nofollow noreferrer">Laravel Forge</a> and the like. We talk a lot about this on the <a href="https://devmode.fm/episodes/website-deployment-without-tears" rel="nofollow noreferrer">Website Deployment without Tears</a> episode of <a href="https://devmode.fm/" rel="nofollow noreferrer">devMode.fm</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-19T22:38:04.390Z
Answers.LastActivityDate: 2018-05-19T22:38:04.390Z
Answers.UserDisplayName: andrew.welch
Answers.Body: <p>I guess you're seeing this notice, because of pending migrations after an update. After you deployed the repository, you should make sure that:</p>
  <ol>
  <li>Run <code>composer install --no-interaction</code> to install current versions of Craft and Plugins (I guess that already works in your deploy)</li>
  <li>Run <code>./craft migrate/all --interactive=0</code>. This will run pending migrations</li>
  <li>Run <code>./craft project-config/apply --interactive=0</code>. This will apply the current project-config</li>
  <li>Run <code>clear-caches/compiled-templates --interactive=0</code> to clear the cache</li>
  <li>Run <code>clear-caches/cp-resources --interactive=0</code> to clear the cache</li>
  <li>Run <code>clear-caches/data --interactive=0</code> to clear the cache</li>
  </ol>
  <p>That said, Andrew's links are all worth reading and give all these answers.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-24T11:59:48.703Z
Answers.LastActivityDate: 2023-08-24T11:59:48.703Z
Answers.UserDisplayName: Max Strebel
Body: <p>I'm unclear as to the best way to deploy a Craft CMS 3 site. I'm looking for some best practices and guidance.</p>
  
  <p>I'm currently using Rocketeer to deploy the code from my local environment to my staging site. When I do this I get a ServiceUnavailableHttpException. Do I need to install Craft again once it's been deployed to my staging environment? I don't think I need to but I can't figure out why I'm getting this error.</p>
  
  <p>In the past, I've run Craft 2 sites successfully by installing once on each environment and then gitignoring the common files that I want to share. I have a hook in my Rocketeer file that creates symlinks to the common files/directories.</p>
  
  <p>I've thought about taking a similar approach with my Craft 3 site but am unclear as how I would do that now that the the core craft files are required within composer. Move all the core packages to require-dev in my composer file?</p>
  
  <p>Who can help steer me in the right direction?</p>
  
  <p>Thanks in advance!</p>
  
Tags: <craft3><best-practice><deployment>
Title: What is the best way to deploy a Craft CMS 3 site?
ThreadText: # What is the best way to deploy a Craft CMS 3 site?
  
  (Asked by: username_0 on 2018-05-19)
  
  I'm unclear as to the best way to deploy a Craft CMS 3 site. I'm looking for some best practices and guidance.
  
  I'm currently using Rocketeer to deploy the code from my local environment to my staging site. When I do this I get a ServiceUnavailableHttpException. Do I need to install Craft again once it's been deployed to my staging environment? I don't think I need to but I can't figure out why I'm getting this error.
  
  In the past, I've run Craft 2 sites successfully by installing once on each environment and then gitignoring the common files that I want to share. I have a hook in my Rocketeer file that creates symlinks to the common files/directories.
  
  I've thought about taking a similar approach with my Craft 3 site but am unclear as how I would do that now that the the core craft files are required within composer. Move all the core packages to require-dev in my composer file?
  
  Who can help steer me in the right direction?
  
  Thanks in advance!
  
  **Tags:** craft3, best-practice, deployment
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-05-19. Score: 4
  
  At the risk of offering a "link answer", the [Setting up a New Craft CMS 3 Project](https://nystudio107.com/blog/setting-up-a-craft-cms-3-project) has a section on **DEPLOYING CRAFT CMS** that should be useful to you.
  
  I've never heard of Rocketeer, but popular ways to handle deployments are via [buddy.works](http://buddy.works/), [Laravel Forge](https://forge.laravel.com/) and the like. We talk a lot about this on the [Website Deployment without Tears](https://devmode.fm/episodes/website-deployment-without-tears) episode of [devMode.fm](https://devmode.fm/)
  
  
  ---
  
  ### Answer by username_2 on 2023-08-24. Score: 1
  
  I guess you're seeing this notice, because of pending migrations after an update. After you deployed the repository, you should make sure that:
  
  1. Run `composer install --no-interaction` to install current versions of Craft and Plugins (I guess that already works in your deploy)
  2. Run `./craft migrate/all --interactive=0`. This will run pending migrations
  3. Run `./craft project-config/apply --interactive=0`. This will apply the current project-config
  4. Run `clear-caches/compiled-templates --interactive=0` to clear the cache
  5. Run `clear-caches/cp-resources --interactive=0` to clear the cache
  6. Run `clear-caches/data --interactive=0` to clear the cache
  
  That said, Andrew's links are all worth reading and give all these answers.
  
  
  ---
  
  