Deploy meteor apps to your custom server using SSH!


Deploy meteor applications to your own servers using SSH and SFTP. Pull and feature requests are encouraged.

This package will deploy your meteor application in a way to be able to rollback to a previous deployment. Basic filestructure is:

/<configured remote path>/<environment>/
    <projectName>-<deployment timestamp>
  <ProjectName> -> symlink to current deployment
  <ProjectName-previous> -> symlink to previous deployment
npm install -g meteor-deploy

Imagine the following package.json:

  "name": "MyCoolApp",
  "version": "0.1.0",
  "repository": {
    "type": "git",
    "url": ""
  "author": "azhwkd",
  "deployConfig": {
    "alpha": {
      "remote" : "",
      "port": "22",
      "user": "myCoolSSHUser",
      "cert": "/path/to/my/private/key",
      "passphrase": "coolPass101",
      "remotePath": "/path/where/my/apps/should/run",
      "ref": "origin/alpha",
      "runPort": "3000",
      "rootUrl": "",
      "mongoUrl": "mongodb://localhost:27017/meteor",
      "mailUrl": "smtp://..."

The deployConfig node is the root of all evil. Under it there are so called environment nodes. For every environment you want to deploy to you can add a new object and so every environment can have its own server and credentials.

  • remote The server you want to deploy to. Has to have an SSH server with SFTP subsystem.
  • port (Optional) The port of your SSH server. Defaults to 22 if not declared otherwise.
  • user The username to use for the SSH connection.
  • cert The private key file for your SSH user.
  • passphrase (Optional) Passphrase for your SSH cert. Only needed if your cert has one set.
  • remotePath The absolute path on the server where you want to run the app.
  • ref (Optional) a git reference in the form of [remote]/[branch]. The git HEAD will get reset to this reference. Defaults to the latest ref.
  • runPort (Optional) If specified then this value will get passed to meteor in the PORT env var. Defaults to 3000
  • rootUrl The url root of your application.
  • mongoUrl (Optional) The connection string to your mongoDB. Defaults to mongodb://localhost:27017/meteor
  • mailUrl (Optional) If your app uses mail you have to set this to a valid smtp uri.
Usage: meteor-deploy [options] [command]
    rollback               Rolls back to the last deployed version.
    deploy                 Deploys the git repository to a remote server.
    -h, --help           output usage information
    -V, --version        output the version number
    --env <environment>  Deploy to the provided environment.
    --mrt                Deploy using meteorite. Default false.
    -f, --forever        Attempt to start/restart the program on the server using forever.