Servers & Stacks

Add the places your code is deployed to, from SSH/SFTP and FTP to S3, and deploy to several at once with stacks.

A server is a place your code is deployed to: a host reached over SSH/SFTP or FTP, or a cloud storage bucket. A stack groups servers so one deployment updates all of them.

Add a server

In a project, open Servers & Stacks and choose New Server. The form has two parts.

Server details

NameHow the server appears in Donkey, for example Production.
Repository branchThe branch deployed to this server. A server in a stack uses the stack's branch.
ProtocolHow Donkey connects. See Protocols.
Remote pathWhere the files are uploaded on the server, absolute or relative to the login directory. The user must be able to create files and folders there. For storage buckets this is a path prefix.

Additional details

Local path optionalA folder of the repository to upload from, such as public. Leave it empty to upload the whole repository.
Stack optionalAdds the server to a stack.

Donkey checks the connection when you save and tells you if it can't log in or write to the remote path. To deploy the server on every push, turn on automatic deployment once it is created; see Webhooks.

Protocols
ProtocolWhat you enter
SSH/SFTPHostname, port (22 if empty), username, and a key or a password. The only protocol that can run SSH commands.
FTPHostname, port, username and password. Tick Use Passive Mode if the server or a firewall needs it.
FTPSAs FTP, over TLS. Leave the TLS version on default unless your server needs a specific one.
S3Bucket name, Access Key ID and Secret Access Key of an AWS user that can write to the bucket.
Rackspace Cloud StorageRegion, container name, username and API key.
Google Cloud StorageBucket name, and the key (the JSON file's contents) of a service account that can write to the bucket.

The hostname is an address only, such as example.com, 203.0.113.5 or 2001:db8::1; put the port in its own field.

Key or password authentication

For SSH/SFTP, choose an authentication mode:

  • Key based (recommended): copy the SSH public key shown on the form and add it as one line to ~/.ssh/authorized_keys of the user on the server. It is the project's deployment key, so every server of the project can use the same one.
  • Password based: enter the user's password. It is stored encrypted.
# on the server, as the deploying user
mkdir -p ~/.ssh && chmod 700 ~/.ssh
echo "<the SSH public key from the form>" >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys
Firewalls

If your server only accepts connections from known addresses, allow these IPs through your firewall:

  • 195.201.134.195
  • 195.201.134.196
Clone, edit and delete
  • Clone makes a copy of a server with the same branch, connection details and paths, which is handy for a second environment. Change the remote path of the copy so the two don't overwrite each other.
  • Edit has three tabs: General, Connection & Authentication and Automatic Deployment.
  • Delete removes the server and its deployment history. The files already deployed stay on the server.
Stacks

A stack deploys the same commit to several servers in one go, for example the web servers behind a load balancer. Create the servers first, then in Servers & Stacks choose New Stack:

NameHow the stack appears in Donkey.
BranchUsed by every server of the stack, in place of their own.
ServersThe servers of the project to include.
Deploy strategyParallel deploys all servers at once. Sequential deploys one server at a time, in the order you set by dragging the servers or using the arrows. It is slower, but a bad release can stop before it reaches every server.
Continue if one failsSequential only. Off, the deployment stops at the first failed server; on, it carries on with the next ones.
  • A stack deployment runs the build commands once and uploads the result to every server.
  • A server in a stack takes the stack's branch and automatic deployment settings. Its own automatic deployment link stops working until it leaves the stack.
  • Deleting a stack deletes its deployments. Its servers are kept and become single servers again.
Still need help?

Tell us what you are trying to do and we will reply by e-mail.

Contact support