Statamic deployment options
Learn here how to install Statamic on fortrabbit.
# Get ready
- Have a local development environment with PHP and a web server ready.
- Have Statamic installed locally.
# Deployment workflow introduction
There are two "main" ways to deploy code here on fortrabbit: Git and SFTP. The general rule of thumb is, that content driven legacy applications, like WordPress, are better uploaded in classical manner with SFTP. Modern PHP web frameworks that are based on Composer are mostly deployed with Git.
Now, Statamic is a bit in between and is - like Grav and Kirby - file based. So there is usually no database, the actual contents are text files written on the file system.
Files you can access via SFTP or SSH are not the exact ones that are in Git. The Git repo is a separate thing. This means that deploying with Git is a one way street that only goes up. In other words: You can NOT git pull any changes you have made on the environment's file system. In an ideal world, code and content are maybe separated. With a file based CMS this is all together.
# Deployment options
Here are three ways to get your code up (and down):
# 1 - SFTP upload
There is not much to say on that topic. Just make sure to upload all contents of your local Statamic folder, including the hidden .htaccess file into the htdocs folder within your environment. Consider using rsync to sync all contents all up and down.
# 2 - Git + rsync workflow (recommended)
Manage template code with Git and content with rsync. Instructions over here.
# 3 - Git experimental workflow
Feeling adventurous? Use Git on the App to be able to push/pull contents. Instructions over here.