There is no need for a “cloud” environment at all. Every developer should have their own development environment. This may be local or on a server, and this may or may not be a virtual machine. The important point is that developers can work on their own, without accidentally overwriting the work of another team member.
Version control is important for collaboration because it allows the changes of multiple team members to be merged together without accidentally overwriting something. With Git, a pull-request based workflow gives other team members the opportunity to review proposed changes before they are merged into the master branch. Automated tests as part of this review are considered to be a best practice. These automated tests would typically run on some build server, which might be a VM on a shared server. The build server runs automated, so developers should not log in except for debugging or administration.
The master branch can then be deployed to a production environment. This may happen semi-automatically if you're trying to do Continuous Deployment. Because all changes have already been tested and reviewed as a pull request, you can always deploy the master branch. If there should be a problem, you can always revert the master branch to a previous, known-good state and redeploy.
Especially for Git, there are many workflows that discuss how these general concepts can be structured precisely. They differ in some goals, e.g. the popular Git Flow assumes infrequent, well defined releases. Especially for webdev, a workflow centered around continuous deployment may be more appropriate.
These workflows also scale differently. As long as there's a single team there shouldn't be a problem, but multiple teams collaborating on a single code base are always more difficult. It is then necessary to have a project manager or product manager who coordinates the work between teams. Neither version control nor virtual machines can solve communication problems. You need people for that.