I want to deploy a local craftCMS 3 website to a server, but I didn't manage to get answers to some of the questions I have rightnow on Google search. So I hope you can help me with this and can help me finding the right / a better workflow to do these things instead of me reinventing the wheel.
I have the website build locally and want to deploy it. I installed composer on the webserver via SSH by putty (Win) and installed Craft 3 on the server with composer and the craft webinstaller whithout any problems. But that's obviously just an empty craftcms and not the locally build cms.
These are the questions I have right now:
1) What's the preferred way to install a build craft website on the server? Do you use the craft installer or just copy all local files of the project to the server by FTP?
When creating a new craft project with composer the 'public' files are in 'web'. So if I install a new craft project with composer on the webserver inside public_html, the public files will be in domain.com/project/web
or in domain/web
if I use public_html as a path.
But in both cases some critical files, like the config files with passwords and all, will be in the public_html folder.
Of coarse I use htaccess to protect things, but I'm not sure this is the right and secure location to have this folderstructure on the server as meant to be and wonder if the project should go on a higher folder instead with only 'web' exposed on public_html.
2) What's the right location on the server to install the craft project to to keep everything secure, like having config, vendor and all 'out of sight'? Do you guys install craft directly in the public_html folder, or on a higher parent folder? And in case of the latter do you only have the 'web' folder inside public_html somehow (how to do that?)? So what's the right/preferred way/location to install Craft3 in a secure way?
With an older CMS/framework I used I just copied local files by ftp to deploy. But it seems like using composer is a better way to do this and like to improve my workflow.
3) If you make changes to the website locally, how do you deploy them once the website is setup on the server? Do you just use ftp to upload your changed files (and update the database) or is there a better way to do this with composer?
I like to do things in a way that works best and the CMS is meant for instead of reinventing the wheel and do things differently than the 'standard'. Hope you guys can help. Thanks in advance!