SSH

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.

Accessing SSH

Execute the following in your terminal:

# Login to your App by SSH like so:
$ ssh {{ssh-user}}@deploy.{{region}}.frbit.com
# Unless you are using public key: You will be asked for your Account password

When it worked, you will see small a welcome screen:

–––––––––––––––––––––––  ∙ƒ  –––––––––––––––––––––––

You are now logged in to your App by SSH. See below if you got an error.

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 explicity:

# will work
$ php artisan some:command
$ php some-script.php

# will _not_ work:
$ ./artisan some:command
$ ./some-script.php

Syncing code with rsync

rsync is a super cool deployment tool that adds on top of SSH. Please read the dedicated rsync article.

Using Composer

Using Git deployment will trigger Composer automatically. So usually, you don't need to run Composer on the App itself. Really. When you find yourself running Composer on the App itself, chances are that you are doing something wrong there. Think twice, ask us in doubt. If you still need to run Composer manually on the App, you can, please don't use composer update, that will cause memory problems in most cases. Use composer install instead. Again, running Composer directly on the App is for edge cases.

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 authentication

Got an error when trying to login? fortrabbit supports username + password and public key authentication. The latter is recommend, but, especially when using Windows, sometimes password is the only feasible option. Please go on here:

Blacklisting

When nothing works any more, see if you are blacklisted, more here.

Further readings

Craft CMS

Install guides

Develop & deploy

Teamwork

Platform

Stacks

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