1

I am new to Craft 3 and never set up a local environment with composer, bitbucket and gulp. So I dived into all these things to get my hands on Craft 3. At the moment I am using a shared hosting without a ssh access so I have to deploy my site by using FTP Upload. Is it correct that I just need to upload the entire Craft folder with all its subcategories (/vendors, /config, /modules etc. etc.) after development to the production server and then just to adapt the .env file?

I am a little bit curious about this, since it is recommended not to upload some of the sensitive folders with access to a repo. I know that this due to the fact that nobody should see your logins public. This does not apply for the production server? If I point my subdomain to the /web folder with its index.php on the production server everything should be fine? Just want to be sure.

1 Answer 1

5

So the way I'd recommend doing it is that you use .gitignore to exclude your /vendor directory from the repo; a good starter .gitignore file can be found here: https://github.com/nystudio107/craft-scripts/blob/master/example.gitignore

Then you'll work on it in local dev, update Craft/plugins in local dev, and on deploy to production have it do composer install to update your /vendor dir to match what is is your composer.lock file.

The article Setting up a New Craft CMS 3 Project covers this in the DEPLOYING CRAFT CMS section.

You also might want to get a workflow set up for syncing the database and assets as per the Database & Asset Syncing Between Environments in Craft CMS article.

2
  • Hi Andrew thanks for your detailed answer. Yes, I read this article carefully and I am already aware how to use gitignore. Since I can't push the repro to the production server I just want to get sure that this is the right way: Working on local dev (using gitignore with git to store a save copy) and then during production use composer install and upload the entire local folder (with vendors, env.file etc. etc.) to my shared server where the domain points to the /web folder avoiding to grant access to the sensitive files (env.file, db.php etc.)?
    – Pascal G.
    Jan 23, 2018 at 13:07
  • Yep, that's correct! Jan 23, 2018 at 23:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.