{"_id":"593698c6f28b7a000ff06873","project":"543026235eceb608003fde5f","version":{"_id":"59365226e16643001bac5030","project":"543026235eceb608003fde5f","__v":1,"createdAt":"2017-06-06T06:56:38.999Z","releaseDate":"2017-06-06T06:56:38.999Z","categories":["59365227e16643001bac5031","59365227e16643001bac5032","59365227e16643001bac5033","59365227e16643001bac5034"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0.0"},"category":{"_id":"59365227e16643001bac5032","version":"59365226e16643001bac5030","project":"543026235eceb608003fde5f","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-06-05T10:03:36.502Z","from_sync":false,"order":1,"slug":"getting-started-from-supportghostorgdevelopers","title":"Self-Host Install & Setup"},"user":"5736eb0b1a48812200566f0d","__v":2,"parentDoc":null,"updates":["5937da068e8d9b002f1df622","593a7d138b45d0000fe24b01"],"next":{"pages":[],"description":""},"createdAt":"2017-06-06T11:57:58.010Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Warning\",\n  \"body\": \"Ghost 1.0 Beta is not suitable for production!\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Pre-requisites\"\n}\n[/block]\n- **[Node.js](https://nodejs.org)** (See [Supported Node Versions](/v1.0.0/docs/supported-node-versions))\n- **[npm](npmjs.com)** or **[yarn](https://yarnpkg.com)**\n- **c++ compiler**\n\n### Installing Node\n\nThe easiest way to install Node.js is via the [node version manager](https://github.com/creationix/nvm), otherwise look at the official [node instructions](https://nodejs.org/en/download/package-manager/). \n\n### Installing npm or yarn\n\nInstalling Node.js will automatically install `npm`. The Ghost-CLI supports both `yarn` and `npm`.\n\nIf you would like to install `yarn`, we simply recommend using this [\"Installation Script\" instructions](https://yarnpkg.com/en/docs/install#alternatives-tab) because it works better with `nvm`. Furthermore we recommend using [`yarn`](https://yarnpkg.com) **>= 0.23.x**.\n\n### c++ compiler\n\nFurthermore, your system needs a `c++` compiler. MacOSX users need [Xcode](https://developer.apple.com/xcode/) to be installed, Ubuntu Linux needs the [build essentials](https://packages.ubuntu.com/xenial/build-essential) typically installed with `sudo apt-get install build-essential`.\n[block:api-header]\n{\n  \"title\": \"Install Ghost-CLI\"\n}\n[/block]\n```\nnpm install -g ghost-cli\n\n[yarn global add ghost-cli]\n```\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"`ghost-cli:::at:::latest` will ensure the latest version, handy for an upgrade or if you're not sure if you already have it installed.\",\n  \"title\": \"Note\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Install Ghost\"\n}\n[/block]\nAfter installing the `ghost-cli`, you should have global access to `ghost` in your terminal. Try `ghost --help`.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"You have to run `ghost` within the directory you would like to install Ghost. Furthermore the directory has to be empty.\"\n}\n[/block]\n<pre><strong>mkdir /path/to/your/blog</strong></pre>\n\n+ create new folder\n+ e.g. ~/ghost or /home/your-user/ghost or /opt/ghost\n\n<pre><strong>cd /path/to/your/blog</strong></pre>\n\n+ navigate to the new folder\n\n<pre><strong>ghost install local</strong></pre>\n\n+ will install and start your blog, as well as setup and auto-configure any related services needed to run Ghost.\n[block:api-header]\n{\n  \"title\": \"Update Ghost to a newer Version\"\n}\n[/block]\n**Later** on, when there's a new beta version available, you can simply upgrade your current version using the CLI.\n\n<pre><strong>cd /path/to/your/blog</strong></pre>\n\n+ navigate back to your Ghost directory\n\n<pre><code>**ghost update**</code></pre>\n\n+ use this command to pull the newest version and install\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"There's no need to stop Ghost first. `ghost update` will handle stopping and restarting Ghost for you. One command is all you need ๐ŸŽ‰\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Start and stop Ghost\"\n}\n[/block]\n<pre><strong>ghost ls</strong></pre>\n\n+ list all running blogs\n+ command must be executed in your Ghost directory\n\n<pre><strong>ghost start</strong></pre>\n\n+ start your blog\n+ command must be executed in your Ghost directory\n+ `ghost` starts the blog in the folder you have navigated to\n\n<pre><strong>ghost stop</strong></pre>\n\n+ stop your blog\n+ command must be executed in your Ghost directory\n+ `ghost` stops the blog in the folder you have navigated to\n[block:api-header]\n{\n  \"title\": \"Access Ghost logs\"\n}\n[/block]\n<pre><strong>ghost ls</strong></pre>\n\n+ copy the name of your blog\n+ command must be executed in your Ghost directory\n\n<pre><strong>ghost log $NAME</strong></pre>\n\n+ print logs\n\n<pre><strong>ghost log $NAME -f</strong></pre>\n\n+ `-f` tells the CLI to tail the log\n+ tails the log of your blog\n\n## Feedback\n\nWe are happy about any Feedback.\n\nPlease swing by our [slack channel](https://slack.ghost.org) or send a mail to dev@ghost.org.\n[block:api-header]\n{\n  \"title\": \"Troubleshooting\"\n}\n[/block]\nComing soon...","excerpt":"How to install Ghost on your server!","slug":"installing-ghost-via-the-cli","type":"basic","title":"Installing Ghost via the CLI"}

Installing Ghost via the CLI

How to install Ghost on your server!

[block:callout] { "type": "warning", "title": "Warning", "body": "Ghost 1.0 Beta is not suitable for production!" } [/block] [block:api-header] { "title": "Pre-requisites" } [/block] - **[Node.js](https://nodejs.org)** (See [Supported Node Versions](/v1.0.0/docs/supported-node-versions)) - **[npm](npmjs.com)** or **[yarn](https://yarnpkg.com)** - **c++ compiler** ### Installing Node The easiest way to install Node.js is via the [node version manager](https://github.com/creationix/nvm), otherwise look at the official [node instructions](https://nodejs.org/en/download/package-manager/). ### Installing npm or yarn Installing Node.js will automatically install `npm`. The Ghost-CLI supports both `yarn` and `npm`. If you would like to install `yarn`, we simply recommend using this ["Installation Script" instructions](https://yarnpkg.com/en/docs/install#alternatives-tab) because it works better with `nvm`. Furthermore we recommend using [`yarn`](https://yarnpkg.com) **>= 0.23.x**. ### c++ compiler Furthermore, your system needs a `c++` compiler. MacOSX users need [Xcode](https://developer.apple.com/xcode/) to be installed, Ubuntu Linux needs the [build essentials](https://packages.ubuntu.com/xenial/build-essential) typically installed with `sudo apt-get install build-essential`. [block:api-header] { "title": "Install Ghost-CLI" } [/block] ``` npm install -g ghost-cli [yarn global add ghost-cli] ``` [block:callout] { "type": "info", "body": "`ghost-cli@latest` will ensure the latest version, handy for an upgrade or if you're not sure if you already have it installed.", "title": "Note" } [/block] [block:api-header] { "title": "Install Ghost" } [/block] After installing the `ghost-cli`, you should have global access to `ghost` in your terminal. Try `ghost --help`. [block:callout] { "type": "info", "title": "Note", "body": "You have to run `ghost` within the directory you would like to install Ghost. Furthermore the directory has to be empty." } [/block] <pre><strong>mkdir /path/to/your/blog</strong></pre> + create new folder + e.g. ~/ghost or /home/your-user/ghost or /opt/ghost <pre><strong>cd /path/to/your/blog</strong></pre> + navigate to the new folder <pre><strong>ghost install local</strong></pre> + will install and start your blog, as well as setup and auto-configure any related services needed to run Ghost. [block:api-header] { "title": "Update Ghost to a newer Version" } [/block] **Later** on, when there's a new beta version available, you can simply upgrade your current version using the CLI. <pre><strong>cd /path/to/your/blog</strong></pre> + navigate back to your Ghost directory <pre><code>**ghost update**</code></pre> + use this command to pull the newest version and install [block:callout] { "type": "info", "title": "Note", "body": "There's no need to stop Ghost first. `ghost update` will handle stopping and restarting Ghost for you. One command is all you need ๐ŸŽ‰" } [/block] [block:api-header] { "title": "Start and stop Ghost" } [/block] <pre><strong>ghost ls</strong></pre> + list all running blogs + command must be executed in your Ghost directory <pre><strong>ghost start</strong></pre> + start your blog + command must be executed in your Ghost directory + `ghost` starts the blog in the folder you have navigated to <pre><strong>ghost stop</strong></pre> + stop your blog + command must be executed in your Ghost directory + `ghost` stops the blog in the folder you have navigated to [block:api-header] { "title": "Access Ghost logs" } [/block] <pre><strong>ghost ls</strong></pre> + copy the name of your blog + command must be executed in your Ghost directory <pre><strong>ghost log $NAME</strong></pre> + print logs <pre><strong>ghost log $NAME -f</strong></pre> + `-f` tells the CLI to tail the log + tails the log of your blog ## Feedback We are happy about any Feedback. Please swing by our [slack channel](https://slack.ghost.org) or send a mail to dev@ghost.org. [block:api-header] { "title": "Troubleshooting" } [/block] Coming soon...