Deploy Craft CMS with Git

Learn how to deploy Craft CMS code base with Git to fortrabbit.

Get ready

For best results here, make sure you have completed all steps from the get ready guide, and have Craft installed locally. This guide is for advanced users, making use of Git and Composer; it can be applied to Professional Apps and Universal Apps on fortrabbit. There is a more basic guide to install Craft using SFTP over here.

Deploy the Craft code base with Git

Trigger the following commands in your local terminal:

# 1. Initialize Git (if not already done)
$ git init

# 2. Add your App's Git remote to your local repo
$ git remote add fortrabbit {{ssh-user}}@deploy.{{region}}.frbit.com:{{app-name}}.git

# 3. Add changes to Git
$ git add -A

# 4. Commit changes
$ git commit -m 'Initial commit'

# 5. Initial push and upstream
$ git push -u fortrabbit main
# The first push takes a little longer
# as it runs Composer

# 6. From there on only
$ git push

Got an error? Please see access troubleshooting and our Git guide.

Next steps

Please also make yourself familiar with the options to deploy the Craft assets folder separately. There are two dedicated guides here, depending on your App's Stack:

Last not least, see our Craft tuning guide to truly master Craft on fortrabbit.

All articles

Craft CMS

Statamic

Install guides

Code access

Deployment

Git

SSH

SFTP

Troubleshooting

DNS

MySQL

TLS (SSL)

htaccess

Development

Teamwork

Platform

Billing

The Dashboard

Stacks

Tips & tricks

Quirks

Support

FAQ

Need individual help?
Learn about Company plans ›
Looking for an old article?
See the full list of articles ›
Found an error?
Contribute on GitHub ›