SSH access
Learn what you can do on the command line with fortrabbit Apps.
Using our Git deployment is great, but sometimes need a little more control. That's where the Secure SHell comes in. SSH is the big brother of SFTP and allows you to directly interact with your App's code. You may want to set up an SSH Key if you don't have one already.
Accessing SSH
Execute the following in your terminal to login to your App.
# Connect to your App via SSH
$ ssh {{ssh-user}}@deploy.{{region}}.frbit.com
If you are asked for a password, it is NOT your Account password. It's likely then that the key has not been imported correctly or the client is sending the wrong key from the default location, and not the one you imported.
If the login went well, you will see a small welcome message:
––––––––––––––––––––––– ∙ƒ –––––––––––––––––––––––
You are now logged in to your App by SSH.
Things to do with SSH
Following a few simple examples, just to give you some ideas:
# Download & unpack wordpress
$ curl https://wordpress.org/latest.tar.gz | tar zx
# Stream your Apache access logs
$ tail -f ../logs/apache_access.log
# Search for 50x responses in apache access
$ grep -E ' 50[0-9] ' ../logs/apache_access.log
Also checkout: WordPress install from SSH, Execute Laravel's artisan.
Executing PHP scripts
If you want to execute PHP scripts, including artisan
and it's like, make sure to specify the PHP interpreter explicitly:
# will work
$ php artisan some:command
$ php some-script.php
# will _not_ work:
$ ./artisan some:command
$ ./some-script.php
Opening a tunnel (for MySQL)
Have a look at these example scenarios
Syncing code with rsync
The rsync tool makes it easy to synchronize files in different (remote) file system folders. Please read the dedicated rsync article.
Using Composer
Using Git deployment will trigger Composer automatically. Therefore, it should not be necessary to run Composer from the App environment. If you still need to run Composer manually on the App, you can. Please think twice before using composer update
, because that will bring your local code out of sync which is likely to cause issues. Use composer install
instead. Again, running Composer directly on the App is probably not what you want to do.
Limitations
- This is not a root shell, so you can't install or remove software packages
- Mind that you are using the same runtime as your web application: resource intensive operations will drain memory and CPU from the web execution
- Crons are managed via the Dashboard, not the shell
- See the specs page for more limits and numbers
Troubleshooting SSH access
Got an error when trying to login by SSH? Please proceed here.
Creating an SSH Key
Please follow the instructions on the SSH Keys page.