{"_id":"59365227e16643001bac503d","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"},"project":"543026235eceb608003fde5f","user":"55acc88c6b4ff90d00784b61","parentDoc":null,"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"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-06-05T14:18:23.692Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"## Installing Ghost via the Ghost-CLI\n\nIf you install Ghost via the CLI, you don't *have* to create a custom configuration file. The CLI does this for you and asks you for the minimum required information. See screenshot below. After the installation was successful, you will find a custom configuration file. Continue reading to learn where the configuration files live and which properties can be set.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/7d09283-cli-install-config.png\",\n        \"cli-install-config.png\",\n        922,\n        380,\n        \"#040404\"\n      ],\n      \"sizing\": \"80\"\n    }\n  ]\n}\n[/block]\n## Custom configuration files\n\nYou are able to add a custom configuration file to override Ghost's default behaviour. Ghost's configuration is managed by [nconf](https://github.com/indexzero/nconf). A custom configuration file must be a valid JSON file and must be located in the root folder.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"development environment\",\n    \"h-1\": \"production environment\",\n    \"0-0\": \"`config.development.json`\",\n    \"0-1\": \"`config.production.json`\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/9c533fd-ghost-tree.png\",\n        \"ghost-tree.png\",\n        594,\n        1019,\n        \"#1b407e\"\n      ],\n      \"sizing\": \"smart\"\n    }\n  ]\n}\n[/block]\n## About Environments\n\nNode.js, and therefore Ghost, has the concept of environments built in. Environments allow you to create different configurations for different modes in which you might want to run Ghost. By default Ghost has two main built-in modes: **development** and **production**.\n\nThe differences between the two modes mean that **development** is geared towards developing and debugging Ghost, whereas **production** is intended to be used when you're running Ghost as a real live blog. You'll find the log output is different in the two modes, the level of concatenation and minification of assets like js and css is higher in production mode, development mode provides more warnings about potential problems with themes and possibly the most noticeable difference is that theme template files are cached in production mode so you'll want to use development mode when creating themes. Essentially, production mode gives priority to performance, whereas development mode gives priority to information.\n\nAs Ghost progresses, these differences will grow and become more apparent, and therefore it will become more and more important that any public blog runs in the **production** environment. This perhaps begs the question, why **development** mode by default, if most people are going to want to run it in **production** mode? Ghost has **development** as the default because this is the environment that is best for debugging problems, which you're most likely to need when getting set up for the first time.\n\n### Ghost in production\n\nIt's highly recommended to use the [Ghost CLI](https://github.com/TryGhost/Ghost-CLI) to install and start Ghost in production.\n\n### Ghost in development\n\nIf you would like to start Ghost in development, you don't have to specify any environment, because development is default.\n\nIf you would like to test starting Ghost in production, you can use:\n\n`NODE_ENV=production node index.js`\n\n## Configuration options\n\nGhost has a number of configuration options which you can add to change things about how Ghost works.\n\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Required\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"`url`\",\n    \"0-1\": \"**only in production**\",\n    \"0-2\": \"Set the public URL for your blog\",\n    \"1-0\": \"`adminUrl`\",\n    \"1-1\": \"no\",\n    \"1-2\": \"You can specify a separated admin url.\",\n    \"2-0\": \"`mail`\",\n    \"2-1\": \"**only in production**\",\n    \"2-2\": \"Add a mail service so that Ghost can send emails such as forgotten password and user invite emails\",\n    \"3-0\": \"`database`\",\n    \"3-1\": \"**only in production**\",\n    \"3-2\": \"The type of database that Ghost uses. This is configured to sqlite3 by default and does not need editing\",\n    \"4-0\": \"`server`\",\n    \"h-3\": \"Example\",\n    \"0-3\": \"url: 'http://example.com'\",\n    \"4-2\": \"Host and port, or socket for Ghost to listen on\",\n    \"4-1\": \"no\",\n    \"5-0\": \"`privacy`\",\n    \"5-1\": \"no\",\n    \"5-2\": \"Disable the Ghost features listed in [PRIVACY.md](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md), e.g. update check, rpc ping, and google fonts\",\n    \"6-0\": \"`paths`\",\n    \"6-1\": \"no\",\n    \"6-2\": \"Customise Ghost's internal paths, e.g. to the content directory\",\n    \"7-0\": \"`maintenance`\",\n    \"7-1\": \"no\",\n    \"7-2\": \"Transform your blog into maintenance mode.\",\n    \"8-0\": \"`referrerPolicy`\",\n    \"8-1\": \"no\",\n    \"8-2\": \"Control the content attribute of the meta referrer tag.\",\n    \"9-0\": \"`useMinFiles`\",\n    \"9-1\": \"no\",\n    \"9-2\": \"Generate assets url with .min notation.\",\n    \"10-0\": \"`storage`\",\n    \"10-1\": \"no\",\n    \"10-2\": \"Set a custom storage adapter, read more here [Using a custom storage module](doc:using-a-custom-storage-module)\",\n    \"11-0\": \"`scheduling`\",\n    \"11-1\": \"no\",\n    \"11-2\": \"Set a custom scheduling adapter, read more here [Using a custom scheduling module](doc:using-a-custom-scheduling-module)\",\n    \"12-0\": \"`logging`\",\n    \"12-1\": \"no\",\n    \"12-2\": \"Configure logging for Ghost.\",\n    \"13-0\": \"`spam`\",\n    \"13-1\": \"no\",\n    \"13-2\": \"Configure spam settings.\",\n    \"14-0\": \"`caching`\",\n    \"14-1\": \"no\",\n    \"14-2\": \"Configure caching settings.\"\n  },\n  \"cols\": 3,\n  \"rows\": 15\n}\n[/block]\n\n\n\n## URL\n\nOne of the first things you should do after installing a Ghost blog, is set the `url` for your blog. This URL must match the `url` you will use to access your blog, if it is not set correctly you may get the error **Access Denied from url** as well as finding that RSS and other external links do not work correctly. \n\n`url` should be set to the full url for your blog including `http://` or if you are [using SSL](doc:how-to-setup-ssl-for-self-hosted-ghost) for your blog and want both the admin and frontend to always be served securely, use `https://`. \n\n### Subpath\n\nIf you want to Ghost to appear on a subpath or subdirectory of your domain, e.g. `http://my-ghost-blog.com/blog/` the full path needs to be specified in the url field. This option is only available when self-hosting Ghost. \n\nIf you get the error **Access Denied from url: someurl.com**. Please use the url configured in your config file, this means there is a mismatch between the url configured, and the url you used to access your blog's admin panel. To solve this you must either update your config file so the url is correct, or change to using the url already configured in your config file when accessing the admin panel. \n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"As with any config change, once you've updated your `url` field so that your url is correct, you'll need to restart Ghost for it to take effect.\"\n}\n[/block]\n### SSL\nGhost has a number of configuration options for working with SSL, and securing the URLs for the admin (`/ghost/`) and the frontend of your blog. SSL is very important for the admin panel, without SSL your username and password are sent in plaintext. SSL ensures your details are kept private.\n\nFor details of how to setup SSL, please follow our [SSL guide](doc:how-to-setup-ssl-for-self-hosted-ghost).\n\nIf you just setup SSL for your blog, and leave your `url` starting with `http://`, Ghost will serve requests made via HTTPS securely, and leave plain HTTP requests alone. Insecure and secure requests will both be available, and there will be no redirects from one to the other.\n\nIf you setup SSL for your blog and change your `url` to `https://`, Ghost will serve all requests securely, all requests made via plain HTTP will be redirected to HTTPS. Your blog will always be secure.\n\nIf you only want to serve your admin panel (i.e. `/ghost/`) via SSL, then you can leave your `url` as starting with `http://` and instead set the following option:\n\n`\"adminUrl\": \"https://example.com\"`\n\nThis will force any HTTP requests for the admin to be redirected via HTTPS. \n\n\n## Mail\n\t \nPossibly the most important piece of configuration is setting up mail so that Ghost can let you reset your password if you forget it. We have a separate [Mail Configuration](doc:mail-config) which will guide you through this process.\n\n## Database\n\nBy default, Ghost comes configured to use an SQLite database, which requires no configuration. \n\nAlternatively Ghost can also be used with a MySQL database by changing the database configuration. You must create a database and user first, you can then change the existing sqlite3 config to something like:\n\n```\n\"database\": {\n  \"client\": \"mysql\",\n  \"connection\": {\n    \"host\": \"127.0.0.1\",\n    \"user\": \"your_database_user\",\n    \"password\": \"your_database_password\",\n    \"database\": \"ghost_db\"\n  }\n}\n```\n\nThe default charset is `utf8mb4` and can't be overridden.\n\n### Number of connections\nYou can also limit the number of simultaneous connections should you wish, by using the pool setting. The default values are `min: 2, max: 10`, which means Ghost will always maintain 2 active database connections. You can set `min: 0` to prevent this.\n\n```\n\"database\": {\n  \"client\": ...,\n  \"connection\": { ... },\n  \"pool\": {\n    \"min\": 2,\n    \"max\": 20\n  }\n}\n```\n\nMore details about the database configuration can be found in the [knex library documentation](http://knexjs.org/#Installation-client).\n\n\n## Server\n\nThe server host and port are the IP address and port number that Ghost should listen on for requests. In the majority of cases this will not need to be changed, with requests being routed from port 80 to Ghost by either nginx (recommended) or apache.\n\n```\n\"server\": {\n    \"host\": \"127.0.0.1\",\n    \"port\": 2368\n}\n```\n\n### Unix Sockets\nGhost can also be configured to listen on a unix socket by changing the server config to something like:\n\n```\n\"server\": {\n    \"socket\": \"path/to/socket.sock\"\n}\n```\n\nThe default permissions are `0660`, but this can also be configured by expanding the socket config:\n\n```\n\"server\": {\n    \"socket\": {\n        \"path\": \"path/to/socket.sock\",\n        \"permissions\": \"0666\"\n   }\n}\n```\n\n## Privacy\n\nThere are a set of configuration options available to turn off all of the features listed in the [PRIVACY.md](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md) file. All of these feature are enabled by default, but users may choose to turn them off in order to protect their privacy. \n\nIf you simply want to turn off all of these features, you can do so by adding the following to your config file.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"Once the `useTinfoil` flag is set to true, no other privacy flags will take effect.\"\n}\n[/block]\n```\n\"privacy\": {\n    \"useTinfoil\": true,\n}\n```\n\nAlternatively, you can configure each of the features individually.\n \n```\n\"privacy\": {\n    \"useUpdateCheck\": false,\n    \"useGravatar\": false,\n    \"useRpcPing\": false,\n    \"useStructuredData\": false\n}\n```\n\n### Update Check\n\nGhost introduced an automatic update check service to let you know when a new version of Ghost is available (woo!). Ghost.org collects basic anonymous usage statistics from update check requests. \n\nSee [PRIVACY.md#automatic-update-checks](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md#automatic-update-checks) for more details.\n\nDisable with:\n```\n\"privacy\": {\n    \"useUpdateCheck\": false\n}\n```\n\nPlease be sure to subscribe to emails from Ghost, or the [dev blog](https://dev.ghost.org/tag/releases/), so that you are still informed about new versions.\n\n### Gravatar\n\nSee [PRIVACY.md#gravatar](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md#gravatar) for more details.\n\nDisable with:\n\n```\n\"privacy\": {\n    \"useGravatar\": false\n}\n```\n\n### RPC Ping\n\nSee [PRIVACY.md#rpc-pings](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md#rpc-pings) for more details.\n\nDisable with:\n\n```\n\"privacy\": {\n    \"useRpcPing\": false\n}\n```\n\n### Structured Data\n\nSee [PRIVACY.md#structured-data](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md#structured-data) for more details.\n\nDisable with:\n\n```\n\"privacy\": {\n    \"useStructuredData\": false\n}\n```\n\n## Paths\n\nThe configuration of paths can be relative or absolute.\n\nIf you wish to use a content directory that does not live inside the Ghost folder, then you can do this by specifying a `paths` object with a new `contentPath`:\n\n```\n\"paths\": {\n    \"contentPath\": \"content/\"\n},\n```\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Note\",\n  \"body\": \"If you are using an SQLite database, you will also need to update the path to your database to match the new location of the data folder.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"If you configure a custom content path, the content directory must exist and contain sub directories for `data`, `images`,  `themes`, `logs` and `adapters`, otherwise Ghost might fail to start.\",\n  \"title\": \"Note\"\n}\n[/block]\n## Maintenance Mode\n\nTo set maintenance mode: \n\n```\n\"maintenance\": { \n  \"enabled\": true \n}\n```\n\nThis will serve 503 HTTP response.\n\n## Referrer Policy\n\nYou can set the value of the content attribute of the meta referrer HTML tag by adding `referrerPolicy` to your config. `origin-when-crossorigin` is default.\n\nRead through all possible options [here](https://www.w3.org/TR/referrer-policy/#referrer-policies). \n\n## Logging\n\nYou can configure how Ghost should log.\n\n```\n\"logging\": {\n  \"path\": \"something/\",\n  \"level\": \"info\",\n  \"rotation\": {\n    \"enabled\": false\n  },\n  \"transports\": [\"stdout\"]\n}\n```\n\n\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`level`\",\n    \"0-1\": \"The default log level is `info`, which will print all info, warning and error logs.Info logs are for example requests.\\n\\nYou can set it to `error` to only print errors.\",\n    \"1-0\": \"`rotation`\",\n    \"1-1\": \"You can tell Ghost to rotate your log files.\\n\\nBy default, it's true for production and false for development environment.\",\n    \"2-0\": \"`transports`\",\n    \"2-1\": \"The transport define where Ghost should log to.\\n\\nBy default, Ghost will write to stdout and into file for production and to stdout only for development.\\n\\ne.g. `[\\\"file\\\", \\\"stdout\\\"]`\",\n    \"3-0\": \"`path`\",\n    \"3-1\": \"By default, Ghost logs into your content path e.g. `content/logs/`.\\n\\nYou can set any path here. But note: the permissions must be correct to write into this folder.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n## Spam\n\nYou can tell Ghost how to treat spam requests.\n\nSee [spam configuration in Ghost](https://github.com/TryGhost/Ghost/blob/master/core/server/config/defaults.json#L26).\n\n## Caching\n\nCaching for sitemaps, redirects or assets can be configured via the `caching` property.\nSee [caching configuration in Ghost](https://github.com/TryGhost/Ghost/blob/master/core/server/config/defaults.json#L57).","excerpt":"","slug":"configuring-ghost","type":"basic","title":"Configuring Ghost"}
## Installing Ghost via the Ghost-CLI If you install Ghost via the CLI, you don't *have* to create a custom configuration file. The CLI does this for you and asks you for the minimum required information. See screenshot below. After the installation was successful, you will find a custom configuration file. Continue reading to learn where the configuration files live and which properties can be set. [block:image] { "images": [ { "image": [ "https://files.readme.io/7d09283-cli-install-config.png", "cli-install-config.png", 922, 380, "#040404" ], "sizing": "80" } ] } [/block] ## Custom configuration files You are able to add a custom configuration file to override Ghost's default behaviour. Ghost's configuration is managed by [nconf](https://github.com/indexzero/nconf). A custom configuration file must be a valid JSON file and must be located in the root folder. [block:parameters] { "data": { "h-0": "development environment", "h-1": "production environment", "0-0": "`config.development.json`", "0-1": "`config.production.json`" }, "cols": 2, "rows": 1 } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/9c533fd-ghost-tree.png", "ghost-tree.png", 594, 1019, "#1b407e" ], "sizing": "smart" } ] } [/block] ## About Environments Node.js, and therefore Ghost, has the concept of environments built in. Environments allow you to create different configurations for different modes in which you might want to run Ghost. By default Ghost has two main built-in modes: **development** and **production**. The differences between the two modes mean that **development** is geared towards developing and debugging Ghost, whereas **production** is intended to be used when you're running Ghost as a real live blog. You'll find the log output is different in the two modes, the level of concatenation and minification of assets like js and css is higher in production mode, development mode provides more warnings about potential problems with themes and possibly the most noticeable difference is that theme template files are cached in production mode so you'll want to use development mode when creating themes. Essentially, production mode gives priority to performance, whereas development mode gives priority to information. As Ghost progresses, these differences will grow and become more apparent, and therefore it will become more and more important that any public blog runs in the **production** environment. This perhaps begs the question, why **development** mode by default, if most people are going to want to run it in **production** mode? Ghost has **development** as the default because this is the environment that is best for debugging problems, which you're most likely to need when getting set up for the first time. ### Ghost in production It's highly recommended to use the [Ghost CLI](https://github.com/TryGhost/Ghost-CLI) to install and start Ghost in production. ### Ghost in development If you would like to start Ghost in development, you don't have to specify any environment, because development is default. If you would like to test starting Ghost in production, you can use: `NODE_ENV=production node index.js` ## Configuration options Ghost has a number of configuration options which you can add to change things about how Ghost works. [block:parameters] { "data": { "h-0": "Name", "h-1": "Required", "h-2": "Description", "0-0": "`url`", "0-1": "**only in production**", "0-2": "Set the public URL for your blog", "1-0": "`adminUrl`", "1-1": "no", "1-2": "You can specify a separated admin url.", "2-0": "`mail`", "2-1": "**only in production**", "2-2": "Add a mail service so that Ghost can send emails such as forgotten password and user invite emails", "3-0": "`database`", "3-1": "**only in production**", "3-2": "The type of database that Ghost uses. This is configured to sqlite3 by default and does not need editing", "4-0": "`server`", "h-3": "Example", "0-3": "url: 'http://example.com'", "4-2": "Host and port, or socket for Ghost to listen on", "4-1": "no", "5-0": "`privacy`", "5-1": "no", "5-2": "Disable the Ghost features listed in [PRIVACY.md](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md), e.g. update check, rpc ping, and google fonts", "6-0": "`paths`", "6-1": "no", "6-2": "Customise Ghost's internal paths, e.g. to the content directory", "7-0": "`maintenance`", "7-1": "no", "7-2": "Transform your blog into maintenance mode.", "8-0": "`referrerPolicy`", "8-1": "no", "8-2": "Control the content attribute of the meta referrer tag.", "9-0": "`useMinFiles`", "9-1": "no", "9-2": "Generate assets url with .min notation.", "10-0": "`storage`", "10-1": "no", "10-2": "Set a custom storage adapter, read more here [Using a custom storage module](doc:using-a-custom-storage-module)", "11-0": "`scheduling`", "11-1": "no", "11-2": "Set a custom scheduling adapter, read more here [Using a custom scheduling module](doc:using-a-custom-scheduling-module)", "12-0": "`logging`", "12-1": "no", "12-2": "Configure logging for Ghost.", "13-0": "`spam`", "13-1": "no", "13-2": "Configure spam settings.", "14-0": "`caching`", "14-1": "no", "14-2": "Configure caching settings." }, "cols": 3, "rows": 15 } [/block] ## URL One of the first things you should do after installing a Ghost blog, is set the `url` for your blog. This URL must match the `url` you will use to access your blog, if it is not set correctly you may get the error **Access Denied from url** as well as finding that RSS and other external links do not work correctly. `url` should be set to the full url for your blog including `http://` or if you are [using SSL](doc:how-to-setup-ssl-for-self-hosted-ghost) for your blog and want both the admin and frontend to always be served securely, use `https://`. ### Subpath If you want to Ghost to appear on a subpath or subdirectory of your domain, e.g. `http://my-ghost-blog.com/blog/` the full path needs to be specified in the url field. This option is only available when self-hosting Ghost. If you get the error **Access Denied from url: someurl.com**. Please use the url configured in your config file, this means there is a mismatch between the url configured, and the url you used to access your blog's admin panel. To solve this you must either update your config file so the url is correct, or change to using the url already configured in your config file when accessing the admin panel. [block:callout] { "type": "info", "title": "Note", "body": "As with any config change, once you've updated your `url` field so that your url is correct, you'll need to restart Ghost for it to take effect." } [/block] ### SSL Ghost has a number of configuration options for working with SSL, and securing the URLs for the admin (`/ghost/`) and the frontend of your blog. SSL is very important for the admin panel, without SSL your username and password are sent in plaintext. SSL ensures your details are kept private. For details of how to setup SSL, please follow our [SSL guide](doc:how-to-setup-ssl-for-self-hosted-ghost). If you just setup SSL for your blog, and leave your `url` starting with `http://`, Ghost will serve requests made via HTTPS securely, and leave plain HTTP requests alone. Insecure and secure requests will both be available, and there will be no redirects from one to the other. If you setup SSL for your blog and change your `url` to `https://`, Ghost will serve all requests securely, all requests made via plain HTTP will be redirected to HTTPS. Your blog will always be secure. If you only want to serve your admin panel (i.e. `/ghost/`) via SSL, then you can leave your `url` as starting with `http://` and instead set the following option: `"adminUrl": "https://example.com"` This will force any HTTP requests for the admin to be redirected via HTTPS. ## Mail Possibly the most important piece of configuration is setting up mail so that Ghost can let you reset your password if you forget it. We have a separate [Mail Configuration](doc:mail-config) which will guide you through this process. ## Database By default, Ghost comes configured to use an SQLite database, which requires no configuration. Alternatively Ghost can also be used with a MySQL database by changing the database configuration. You must create a database and user first, you can then change the existing sqlite3 config to something like: ``` "database": { "client": "mysql", "connection": { "host": "127.0.0.1", "user": "your_database_user", "password": "your_database_password", "database": "ghost_db" } } ``` The default charset is `utf8mb4` and can't be overridden. ### Number of connections You can also limit the number of simultaneous connections should you wish, by using the pool setting. The default values are `min: 2, max: 10`, which means Ghost will always maintain 2 active database connections. You can set `min: 0` to prevent this. ``` "database": { "client": ..., "connection": { ... }, "pool": { "min": 2, "max": 20 } } ``` More details about the database configuration can be found in the [knex library documentation](http://knexjs.org/#Installation-client). ## Server The server host and port are the IP address and port number that Ghost should listen on for requests. In the majority of cases this will not need to be changed, with requests being routed from port 80 to Ghost by either nginx (recommended) or apache. ``` "server": { "host": "127.0.0.1", "port": 2368 } ``` ### Unix Sockets Ghost can also be configured to listen on a unix socket by changing the server config to something like: ``` "server": { "socket": "path/to/socket.sock" } ``` The default permissions are `0660`, but this can also be configured by expanding the socket config: ``` "server": { "socket": { "path": "path/to/socket.sock", "permissions": "0666" } } ``` ## Privacy There are a set of configuration options available to turn off all of the features listed in the [PRIVACY.md](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md) file. All of these feature are enabled by default, but users may choose to turn them off in order to protect their privacy. If you simply want to turn off all of these features, you can do so by adding the following to your config file. [block:callout] { "type": "info", "title": "Note", "body": "Once the `useTinfoil` flag is set to true, no other privacy flags will take effect." } [/block] ``` "privacy": { "useTinfoil": true, } ``` Alternatively, you can configure each of the features individually. ``` "privacy": { "useUpdateCheck": false, "useGravatar": false, "useRpcPing": false, "useStructuredData": false } ``` ### Update Check Ghost introduced an automatic update check service to let you know when a new version of Ghost is available (woo!). Ghost.org collects basic anonymous usage statistics from update check requests. See [PRIVACY.md#automatic-update-checks](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md#automatic-update-checks) for more details. Disable with: ``` "privacy": { "useUpdateCheck": false } ``` Please be sure to subscribe to emails from Ghost, or the [dev blog](https://dev.ghost.org/tag/releases/), so that you are still informed about new versions. ### Gravatar See [PRIVACY.md#gravatar](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md#gravatar) for more details. Disable with: ``` "privacy": { "useGravatar": false } ``` ### RPC Ping See [PRIVACY.md#rpc-pings](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md#rpc-pings) for more details. Disable with: ``` "privacy": { "useRpcPing": false } ``` ### Structured Data See [PRIVACY.md#structured-data](https://github.com/TryGhost/Ghost/blob/master/PRIVACY.md#structured-data) for more details. Disable with: ``` "privacy": { "useStructuredData": false } ``` ## Paths The configuration of paths can be relative or absolute. If you wish to use a content directory that does not live inside the Ghost folder, then you can do this by specifying a `paths` object with a new `contentPath`: ``` "paths": { "contentPath": "content/" }, ``` [block:callout] { "type": "info", "title": "Note", "body": "If you are using an SQLite database, you will also need to update the path to your database to match the new location of the data folder." } [/block] [block:callout] { "type": "info", "body": "If you configure a custom content path, the content directory must exist and contain sub directories for `data`, `images`, `themes`, `logs` and `adapters`, otherwise Ghost might fail to start.", "title": "Note" } [/block] ## Maintenance Mode To set maintenance mode: ``` "maintenance": { "enabled": true } ``` This will serve 503 HTTP response. ## Referrer Policy You can set the value of the content attribute of the meta referrer HTML tag by adding `referrerPolicy` to your config. `origin-when-crossorigin` is default. Read through all possible options [here](https://www.w3.org/TR/referrer-policy/#referrer-policies). ## Logging You can configure how Ghost should log. ``` "logging": { "path": "something/", "level": "info", "rotation": { "enabled": false }, "transports": ["stdout"] } ``` [block:parameters] { "data": { "h-0": "Name", "h-1": "Description", "0-0": "`level`", "0-1": "The default log level is `info`, which will print all info, warning and error logs.Info logs are for example requests.\n\nYou can set it to `error` to only print errors.", "1-0": "`rotation`", "1-1": "You can tell Ghost to rotate your log files.\n\nBy default, it's true for production and false for development environment.", "2-0": "`transports`", "2-1": "The transport define where Ghost should log to.\n\nBy default, Ghost will write to stdout and into file for production and to stdout only for development.\n\ne.g. `[\"file\", \"stdout\"]`", "3-0": "`path`", "3-1": "By default, Ghost logs into your content path e.g. `content/logs/`.\n\nYou can set any path here. But note: the permissions must be correct to write into this folder." }, "cols": 2, "rows": 4 } [/block] ## Spam You can tell Ghost how to treat spam requests. See [spam configuration in Ghost](https://github.com/TryGhost/Ghost/blob/master/core/server/config/defaults.json#L26). ## Caching Caching for sitemaps, redirects or assets can be configured via the `caching` property. See [caching configuration in Ghost](https://github.com/TryGhost/Ghost/blob/master/core/server/config/defaults.json#L57).