SSH is a protocol that allows you to securely access your server via a command line terminal.
SSH keys are used to authenticate with your server over the SSH protocol.
If you are new to SSH keys, we recommend checking out the GitHub documentation of generating SSH keys to get started.As part of the provisioning process, Laravel Forge will add all active organization SSH keys to the forge account. This will allow you to SSH into the server as the forge user.After adding your SSH key to your server, you may SSH into the server without a password:
ssh forge@YOUR_SERVERS_PUBLIC_IP_ADDRESS
If you have provisioned a custom server that configures a different SSH port, you will need to provide the port in the command.
To create an organization SSH key, navigate to the organization’s dashboard and click Settings. Then, navigate to the Security page, click the Add SSH key button. After providing a key name and the Public key click Add key.
To delete an organization SSH key, navigate to the organization’s dashboard and click Settings. Then, navigate to the Security tab and click the dropdown next to the key you want to delete. Click Delete and confirm that you want to delete the key.
Laravel Forge will not automatically remove organization SSH keys from servers. You must do this manually.
To create an account SSH key, navigate to your account dashboard and click the “SSH” tab. Then, click the “Add key” button. After providing a key name and the Public key, click “Add key”.
To delete an account SSH key, navigate to your account dashboard and click the “SSH” tab. Then, click the dropdown next to the key you want to delete. Click “Delete” and confirm that you want to delete the key.
When deleting an account key, Laravel Forge will also attempt to remove the key from servers.
To create a server SSH key, navigate to the server and click “Settings”. Then, navigate to the “SSH” tab and click the “Add key” button. After providing a key name and the Public key click Add key. If your server has any sites configured with website isolation, you will also be able to select the user to add the key to. By default, this will be the forge user.
To delete a server SSH key, navigate to the server and click “Settings”. Then, navigate to the “SSH” tab and click the dropdown next to the key you want to delete. Click “Delete” and confirm that you want to delete the key.
To add your account’s SSH keys, navigate to the server and click “Settings”. Then, navigate to the “SSH” tab and click the “Add key” button. Click on the “Add from account” dropdown item, then select the key you want to add to the server and click “Add”.
During the provisioning process, Laravel Forge will generate its own keypair so that it may access the server. It will add the public key from this keypair to the ~/.ssh/authorized_keys file of both the root and forge users.
During the provisioning process, Laravel Forge will generate a public key for the forge user. This is used by Git to clone the projects to your server. The key will be added to the source control provider. This key is located at /home/forge/.ssh/id_rsa.pub.
When you add the server’s SSH key to your source control provider, the server gains access to all repositories accessible by your source control account. If the server is compromised, an attacker could potentially access any repository your account can reach. For enhanced security, consider using deploy keys to limit access to only the specific repositories each site requires.
Alternatively, you may opt out of having this key added to your source control providers by un-checking the Add server’s SSH key to source control providers option when creating a server. When opting-out, you will need to use site-level deploy keys in order to grant your server access to specific repositories on a source control provider such as GitHub, GitLab, or Bitbucket.
Sometimes you may wish to only grant the Laravel Forge user access to a specific repository. This is typically accomplished by adding an SSH key to that repository’s “Deploy Keys” on the repository’s GitHub, GitLab, or Bitbucket dashboard.When adding a new site to the server, you may choose to generate a Deploy Key for that application. Once the key has been generated, you can add it to the repository of your choice via your source control provider’s dashboard - allowing the server to clone that specific repository. You may also add, retrieve, or remove a deploy key for an existing site through the API - see managing a site deploy key via the API.
Deploy keys provide better security isolation than server-level SSH keys. Each deploy key only grants access to a single repository, so if a server is compromised, the attacker can only access the repositories explicitly configured with deploy keys on that server—not your entire source control account.
Deploy keys can be used on servers that have their SSH key attached to your source control provider accounts, allowing you to grant the server access to clone a repository that the source control account connected to your Laravel Forge account does not have collaborator access to.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Laravel Forge","colors":{"primary":"#18B69B","light":"#18B69B","dark":"#18B69B"},"logo":{"light":"https://mintcdn.com/forge-laravel/sHyXHYyrLoATu64X/logo/logo.svg?fit=max\u0026auto=format\u0026n=sHyXHYyrLoATu64X\u0026q=85\u0026s=469c693d945743b5870032ffac8d67b7","dark":"https://mintcdn.com/forge-laravel/sHyXHYyrLoATu64X/logo/logo.svg?fit=max\u0026auto=format\u0026n=sHyXHYyrLoATu64X\u0026q=85\u0026s=469c693d945743b5870032ffac8d67b7","href":"https://forge.laravel.com"},"favicon":"https://mintcdn.com/forge-laravel/DhXK7kFkCTo-2V2J/favicon.png?fit=max\u0026auto=format\u0026n=DhXK7kFkCTo-2V2J\u0026q=85\u0026s=eda7438a183a53fc59e814b80feebd59","api":{"playground":{"display":"simple"},"examples":{"languages":["php","bash","javascript","go"]}},"background":{"decoration":"windows"},"navbar":{"primary":{"type":"button","label":"Get started","href":"https://forge.laravel.com"}},"footer":{"socials":{"x":"https://x.com/laravel","github":"https://github.com/laravel","discord":"https://discord.com/invite/laravel","linkedin":"https://linkedin.com/company/laravel"}},"seo":{"metatags":{"canonical":"https://laravel.com/forge/docs"}},"fonts":{"heading":{"family":"Figtree"},"body":{"family":"Figtree"}},"integrations":{"fathom":{"siteId":"UZINDLYX"}},"contextual":{"options":["copy","chatgpt","claude","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/laravel"},{"anchor":"Blog","icon":"newspaper","href":"https://blog.laravel.com"},{"anchor":"Status","icon":"heart-pulse","href":"https://status.on-forge.com"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"forge-laravel","hasAudioNarration":false,"actualSubdomain":"forge-laravel","customDomains":["forge.laravel.com"],"gitSource":{"type":"github","owner":"laravel","repo":"forge-docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae35736befa89197b16df06","collectionId":"706b0864-66ed-4e31-83ec-2dda6fe33b80","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae35736befa89197b16df06"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"REMOVE_BRANDING":{"status":"ENABLED"},"CONTEXTUAL_FEEDBACK":{"status":"ENABLED"},"CODE_SNIPPET_FEEDBACK":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae35736befa89197b16df06","clientVersion":"0.0.4021","searchFilterCounts":[{"language":"default","tag":"Documentation","count":49},{"language":"default","tag":"Sites","count":11},{"language":"default","tag":"Resources","count":10},{"language":"default","tag":"Basics","count":9},{"language":"default","tag":"Servers","count":9},{"language":"default","tag":"Knowledge Base","count":7},{"language":"default","tag":"API Reference","count":5},{"language":"default","tag":"Introduction","count":5},{"language":"default","tag":"Troubleshooting","count":5},{"language":"default","tag":"Integrations","count":4}]},"assistantConfig":{},"basePath":"/docs","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[],"googleFontsInlined":true},"customCss":[{"filePath":"style.css","content":"/* latin-ext */\n@font-face {\n font-family: 'Instrument Sans';\n font-style: normal;\n font-weight: 400 500;\n font-stretch: 100%;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/instrumentsans/v4/pxiTypc9vsFDm051Uf6KVwgkfoSxQ0GsQv8ToedPibnr0She1YmV.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Instrument Sans';\n font-style: normal;\n font-weight: 400 500;\n font-stretch: 100%;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/instrumentsans/v4/pxiTypc9vsFDm051Uf6KVwgkfoSxQ0GsQv8ToedPibnr0SZe1Q.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\n/* cyrillic-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrodmgPn.woff2) format('woff2');\n unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;\n}\n/* cyrillic */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrMdmgPn.woff2) format('woff2');\n unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;\n}\n/* symbols2 */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFg08vz7ehw.woff2) format('woff2');\n unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;\n}\n/* vietnamese */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrgdmgPn.woff2) format('woff2');\n unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;\n}\n/* latin-ext */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrkdmgPn.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;\n}\n/* latin */\n@font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 300 600;\n font-display: swap;\n src: url(/docs/_mintlify/assets/fonts/google/s/geistmono/v6/or3nQ6H-1_WfwkMZI_qYFrcdmg.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n}\nbody{font-family:\"Instrument Sans\";font-weight:400}h1,h2,h3,h4{letter-spacing:-.025rem!important}code,pre{font-family:'Geist Mono',ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,'Liberation Mono','Courier New',monospace}.font-semibold,b,h1,h2,h3,h4,strong{font-weight:500!important}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500!important;color:rgb(var(--primary-light))!important}.codeblock-dark div:not(:last-child){color:#fafafa}"}],"page":{"pagePath":"ssh","slug":"/ssh","pageMetadata":{"title":"SSH Keys","description":"SSH keys are used to authenticate with your server over the SSH protocol.","href":"/ssh"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"SSH keys are used to authenticate with your server over the SSH protocol.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`introduction`,children:`Introduction`}),`\n`,_jsxs(_components.p,{children:[`SSH is a protocol that allows you to securely access your server via a command line terminal.\nSSH keys are used to authenticate with your server over the SSH protocol.\nIf you are new to SSH keys, we recommend checking out the `,_jsx(_components.a,{href:`https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent`,children:`GitHub documentation of generating SSH keys`}),` to get started.`]}),`\n`,_jsxs(_components.p,{children:[`As part of the provisioning process, Laravel Forge will add all active organization SSH keys to the `,_jsx(_components.code,{children:`forge`}),` account. This will allow you to SSH into the server as the `,_jsx(_components.code,{children:`forge`}),` user.`]}),`\n`,_jsx(_components.p,{children:`After adding your SSH key to your server, you may SSH into the server without a password:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ssh`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` forge@YOUR_SERVERS_PUBLIC_IP_ADDRESS`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`If you have provisioned a custom server that configures a different SSH port, you will need to provide the port in the command.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`ssh`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` forge@YOUR_SERVERS_PUBLIC_IP_ADDRESS`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -p`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` YOUR_SERVERS_SSH_PORT_NUMBER`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`managing-organization-ssh-keys`,children:`Managing organization SSH keys`}),`\n`,_jsx(_components.p,{children:`Laravel Forge will automatically add all organization-level SSH keys to any server that is created within the organization.`}),`\n`,_jsx(Heading,{level:`3`,id:`creating-organization-keys`,children:`Creating organization keys`}),`\n`,_jsxs(_components.p,{children:[`To create an organization SSH key, navigate to the organization’s dashboard and click Settings. Then, navigate to the Security page, click the Add SSH key button. After providing a key name and the `,_jsx(_components.strong,{children:`Public key`}),` click Add key.`]}),`\n`,_jsx(Heading,{level:`3`,id:`deleting-organization-keys`,children:`Deleting organization keys`}),`\n`,_jsx(_components.p,{children:`To delete an organization SSH key, navigate to the organization’s dashboard and click Settings. Then, navigate to the Security tab and click the dropdown next to the key you want to delete. Click Delete and confirm that you want to delete the key.`}),`\n`,_jsx(Warning,{children:`Laravel Forge will not automatically remove organization SSH keys from servers. You must do this manually.`}),`\n`,_jsx(Heading,{level:`2`,id:`managing-account-ssh-keys`,children:`Managing account SSH keys`}),`\n`,_jsx(_components.p,{children:`Laravel Forge makes it easy to manage SSH keys on your own account, making it easy to quickly add your own keys to servers.`}),`\n`,_jsx(Heading,{level:`3`,id:`creating-account-keys`,children:`Creating account keys`}),`\n`,_jsxs(_components.p,{children:[`To create an account SSH key, navigate to your account dashboard and click the “SSH” tab. Then, click the “Add key” button. After providing a key name and the `,_jsx(_components.strong,{children:`Public key`}),`, click “Add key”.`]}),`\n`,_jsx(Heading,{level:`3`,id:`deleting-account-keys`,children:`Deleting account keys`}),`\n`,_jsx(_components.p,{children:`To delete an account SSH key, navigate to your account dashboard and click the “SSH” tab. Then, click the dropdown next to the key you want to delete. Click “Delete” and confirm that you want to delete the key.`}),`\n`,_jsx(Warning,{children:_jsx(_components.p,{children:`When deleting an account key, Laravel Forge will also attempt to remove the key from servers.`})}),`\n`,_jsx(Heading,{level:`2`,id:`managing-server-ssh-keys`,children:`Managing server SSH keys`}),`\n`,_jsx(Heading,{level:`3`,id:`creating-server-keys`,children:`Creating server keys`}),`\n`,_jsxs(_components.p,{children:[`To create a server SSH key, navigate to the server and click “Settings”. Then, navigate to the “SSH” tab and click the “Add key” button. After providing a key name and the `,_jsx(_components.strong,{children:`Public key`}),` click Add key. If your server has any sites configured with website isolation, you will also be able to select the user to add the key to. By default, this will be the `,_jsx(_components.code,{children:`forge`}),` user.`]}),`\n`,_jsx(Heading,{level:`3`,id:`deleting-server-keys`,children:`Deleting server keys`}),`\n`,_jsx(_components.p,{children:`To delete a server SSH key, navigate to the server and click “Settings”. Then, navigate to the “SSH” tab and click the dropdown next to the key you want to delete. Click “Delete” and confirm that you want to delete the key.`}),`\n`,_jsx(Heading,{level:`3`,id:`adding-account-keys`,children:`Adding account keys`}),`\n`,_jsx(_components.p,{children:`To add your account’s SSH keys, navigate to the server and click “Settings”. Then, navigate to the “SSH” tab and click the “Add key” button. Click on the “Add from account” dropdown item, then select the key you want to add to the server and click “Add”.`}),`\n`,_jsx(Heading,{level:`2`,id:`server-keys`,children:`Server keys`}),`\n`,_jsx(Heading,{level:`3`,id:`server-public-key`,children:`Server public key`}),`\n`,_jsxs(_components.p,{children:[`During the provisioning process, Laravel Forge will generate its own keypair so that it may access the server. It will add the public key from this keypair to the `,_jsx(_components.code,{children:`~/.ssh/authorized_keys`}),` file of both the `,_jsx(_components.code,{children:`root`}),` and `,_jsx(_components.code,{children:`forge`}),` users.`]}),`\n`,_jsx(Heading,{level:`3`,id:`laravel-forge-public-key`,children:`Laravel Forge public key`}),`\n`,_jsxs(_components.p,{children:[`During the provisioning process, Laravel Forge will generate a public key for the `,_jsx(_components.code,{children:`forge`}),` user. This is used by Git to clone the projects to your server. The key will be added to the source control provider. This key is located at `,_jsx(_components.code,{children:`/home/forge/.ssh/id_rsa.pub`}),`.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`When you add the server’s SSH key to your source control provider, the server gains access to `,_jsx(_components.strong,{children:`all repositories`}),` accessible by your source control account. If the server is compromised, an attacker could potentially access any repository your account can reach. For enhanced security, consider using `,_jsx(_components.a,{href:`#deploy-keys`,children:`deploy keys`}),` to limit access to only the specific repositories each site requires.`]})}),`\n`,_jsxs(_components.p,{children:[`Alternatively, you may opt out of having this key added to your source control providers by un-checking the `,_jsx(_components.strong,{children:`Add server’s SSH key to source control providers`}),` option when creating a server. When opting-out, you will need to use site-level `,_jsx(_components.a,{href:`#deploy-keys`,children:`deploy keys`}),` in order to grant your server access to specific repositories on a source control provider such as GitHub, GitLab, or Bitbucket.`]}),`\n`,_jsx(Heading,{level:`3`,id:`deploy-keys`,children:`Deploy keys`}),`\n`,_jsx(_components.p,{children:`Sometimes you may wish to only grant the Laravel Forge user access to a specific repository. This is typically accomplished by adding an SSH key to that repository’s “Deploy Keys” on the repository’s GitHub, GitLab, or Bitbucket dashboard.`}),`\n`,_jsxs(_components.p,{children:[`When adding a new site to the server, you may choose to generate a Deploy Key for that application. Once the key has been generated, you can add it to the repository of your choice via your source control provider’s dashboard - allowing the server to clone that specific repository. You may also add, retrieve, or remove a deploy key for an existing site through the API - see `,_jsx(_components.a,{href:`/sites/repository-access#managing-a-site-deploy-key-via-the-api`,children:`managing a site deploy key via the API`}),`.`]}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Deploy keys provide better security isolation than server-level SSH keys. Each deploy key only grants access to a single repository, so if a server is compromised, the attacker can only access the repositories explicitly configured with deploy keys on that server—not your entire source control account.`})}),`\n`,_jsx(Tip,{children:_jsx(_components.p,{children:`Deploy keys can be used on servers that have their SSH key attached to your source control provider accounts, allowing you to grant the server access to clone a repository that the source control account connected to your Laravel Forge account does not have collaborator access to.`})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"SSH Keys","description":"SSH keys are used to authenticate with your server over the SSH protocol.","href":"/ssh"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Introduction","slug":"introduction","depth":2,"children":[]},{"title":"Managing organization SSH keys","slug":"managing-organization-ssh-keys","depth":2,"children":[{"title":"Creating organization keys","slug":"creating-organization-keys","depth":3,"children":[]},{"title":"Deleting organization keys","slug":"deleting-organization-keys","depth":3,"children":[]}]},{"title":"Managing account SSH keys","slug":"managing-account-ssh-keys","depth":2,"children":[{"title":"Creating account keys","slug":"creating-account-keys","depth":3,"children":[]},{"title":"Deleting account keys","slug":"deleting-account-keys","depth":3,"children":[]}]},{"title":"Managing server SSH keys","slug":"managing-server-ssh-keys","depth":2,"children":[{"title":"Creating server keys","slug":"creating-server-keys","depth":3,"children":[]},{"title":"Deleting server keys","slug":"deleting-server-keys","depth":3,"children":[]},{"title":"Adding account keys","slug":"adding-account-keys","depth":3,"children":[]}]},{"title":"Server keys","slug":"server-keys","depth":2,"children":[{"title":"Server public key","slug":"server-public-key","depth":3,"children":[]},{"title":"Laravel Forge public key","slug":"laravel-forge-public-key","depth":3,"children":[]},{"title":"Deploy keys","slug":"deploy-keys","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":["/docs/_mintlify/custom/forge-laravel/1bbd0658b78e8288/rudder.js","/docs/_mintlify/custom/forge-laravel/cf2463a5a064fd05/plain.js"],"subdomain":"forge-laravel","siteName":"Laravel Forge","title":"SSH Keys - Laravel Forge","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-20T11:34:37.701Z","originalFileLocation":"ssh.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"SSH keys are used to authenticate with your server over the SSH protocol.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Laravel Forge\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"SSH Keys - Laravel Forge\">\u003cmeta data-mint-head property=\"og:description\" content=\"SSH keys are used to authenticate with your server over the SSH protocol.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Laravel Forge\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://laravel.com/forge/docs/ssh\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://forge-laravel.mintlify.app/_mintlify/api/og/v2?division=Basics\u0026amp;title=SSH+Keys\u0026amp;description=SSH+keys+are+used+to+authenticate+with+your+server+over+the+SSH+protocol.\u0026amp;theme=1c0f39d14eacb1d14985e191\u0026amp;signature=41fee2a5d678a33d14b3f30c000890ff99286d6e7494a13f5021243801c35a89\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"SSH Keys - Laravel Forge\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"SSH keys are used to authenticate with your server over the SSH protocol.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://forge-laravel.mintlify.app/_mintlify/api/og/v2?division=Basics\u0026amp;title=SSH+Keys\u0026amp;description=SSH+keys+are+used+to+authenticate+with+your+server+over+the+SSH+protocol.\u0026amp;theme=1c0f39d14eacb1d14985e191\u0026amp;signature=41fee2a5d678a33d14b3f30c000890ff99286d6e7494a13f5021243801c35a89\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/forge-laravel/c_1rQpFWehdE_YrP/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Laravel Forge\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#18B69B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://laravel.com/forge/docs/ssh\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/ssh.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://laravel.com/#organization\",\"name\":\"Laravel Forge\",\"url\":\"https://laravel.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/forge-laravel/sHyXHYyrLoATu64X/logo/logo.svg?fit=max\u0026auto=format\u0026n=sHyXHYyrLoATu64X\u0026q=85\u0026s=469c693d945743b5870032ffac8d67b7\"}},{\"@type\":\"WebSite\",\"@id\":\"https://laravel.com/forge/docs#website\",\"name\":\"Laravel Forge\",\"url\":\"https://laravel.com/forge/docs\",\"publisher\":{\"@id\":\"https://laravel.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://laravel.com/forge/docs/ssh#webpage\",\"url\":\"https://laravel.com/forge/docs/ssh\",\"name\":\"SSH Keys\",\"description\":\"SSH keys are used to authenticate with your server over the SSH protocol.\",\"dateModified\":\"2026-08-20T11:34:37.701Z\",\"isPartOf\":{\"@id\":\"https://laravel.com/forge/docs#website\"},\"breadcrumb\":{\"@id\":\"https://laravel.com/forge/docs/ssh#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://laravel.com/forge/docs/ssh#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Basics\",\"item\":\"https://laravel.com/forge/docs/organizations\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSH Keys\",\"item\":\"https://laravel.com/forge/docs/ssh\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://laravel.com/forge/docs/ssh#article\",\"headline\":\"SSH Keys\",\"name\":\"SSH Keys\",\"description\":\"SSH keys are used to authenticate with your server over the SSH protocol.\",\"url\":\"https://laravel.com/forge/docs/ssh\",\"mainEntityOfPage\":{\"@id\":\"https://laravel.com/forge/docs/ssh#webpage\"},\"dateModified\":\"2026-08-20T11:34:37.701Z\",\"publisher\":{\"@id\":\"https://laravel.com/#organization\"},\"isPartOf\":{\"@id\":\"https://laravel.com/forge/docs#website\"}}]}\u003c/script>","siteName":"Laravel Forge","nav":{"global":{"anchors":[{"anchor":"Community","icon":"discord","href":"https://discord.gg/laravel"},{"anchor":"Blog","icon":"newspaper","href":"https://blog.laravel.com"},{"anchor":"Status","icon":"heart-pulse","href":"https://status.on-forge.com"}]},"tabs":[{"tab":"Documentation","groups":[{"group":"Get Started","pages":[{"title":"Welcome to Laravel Forge","sidebarTitle":"Introduction","href":"/introduction"},{"title":"Laravel Forge CLI","href":"/cli"},{"title":"Laravel Forge SDK","href":"/sdk"}]},{"group":"Basics","pages":[{"title":"Organizations","href":"/organizations"},{"title":"Teams","href":"/teams"},{"title":"Server Providers","href":"/server-providers"},{"title":"Storage Providers","href":"/storage-providers"},{"title":"Source Control","description":"Source control providers allow Laravel Forge to access your project's codebase and easily deploy your applications.","href":"/source-control"},{"title":"SSH Keys","href":"/ssh"},{"title":"Recipes","description":"Save and run common Bash scripts across your servers.","href":"/recipes"},{"title":"Notifications","href":"/notifications"},{"title":"API","href":"/api"}]},{"group":"Servers","pages":[{"title":"Creating and Managing Servers","sidebarTitle":"Managing Servers","href":"/servers/the-basics"},{"title":"Server Types","href":"/servers/types"},{"title":"Laravel VPS","href":"/servers/laravel-vps"},{"title":"PHP","href":"/servers/php"},{"title":"Load Balancing","href":"/servers/load-balancing"},{"title":"Nginx Templates","href":"/servers/nginx-templates"},{"title":"Root Access / Security","sidebarTitle":"Security","href":"/servers/security"},{"title":"Monitoring","href":"/servers/monitoring"},{"title":"Real-Time Metrics","href":"/servers/real-time-metrics"}]},{"group":"Sites","pages":[{"title":"Creating and Managing Sites","sidebarTitle":"Managing Sites","href":"/sites/the-basics"},{"title":"Domains","href":"/sites/domains"},{"title":"Deployments","href":"/sites/deployments"},{"title":"Repository Access","href":"/sites/repository-access"},{"title":"Environment Variables","href":"/sites/environment-variables"},{"title":"Commands","href":"/sites/commands"},{"title":"Queues","href":"/sites/queues"},{"title":"Network","href":"/sites/network"},{"title":"User Isolation","sidebarTitle":"Isolation","href":"/sites/user-isolation"},{"title":"Laravel","href":"/sites/laravel"},{"title":"Logs","href":"/sites/logs"}]},{"group":"Resources","pages":[{"title":"Databases","href":"/resources/databases"},{"title":"Database Backups","href":"/resources/database-backups"},{"title":"Managed Databases","href":"/resources/managed-databases"},{"title":"Managed Cache","href":"/resources/managed-cache"},{"title":"Object Storage","sidebarTitle":"Object Storage","href":"/resources/object-storage"},{"title":"Caches","href":"/resources/caches"},{"title":"Background Processes","href":"/resources/background-processes"},{"title":"Scheduler","href":"/resources/scheduler"},{"title":"Network","href":"/resources/network"},{"title":"Packages","href":"/resources/packages"}]},{"group":"Integrations","pages":[{"title":"Envoyer","href":"/integrations/envoyer"},{"title":"Sentry","href":"/integrations/sentry"},{"title":"Aikido","href":"/integrations/aikido"},{"title":"OpenClaw","sidebarTitle":"OpenClaw","href":"/integrations/openclaw"}]},{"group":"Other","pages":[{"title":"Support","mode":"wide","href":"/support"},{"title":"Changelog","href":"/changelog"},{"title":"Report Abuse","sidebarTitle":"Abuse","href":"/abuse"}]}]},{"tab":"Knowledge Base","pages":[{"title":"Knowledge Base","href":"/knowledge-base/servers"}]},{"tab":"API Reference","icon":"square-terminal","pages":[{"title":"API Reference","href":"/api-reference/introduction"}]}]},"title":"SSH Keys - Laravel Forge","buildId":"dpl_DGmhKsAzJdVqypJzon18vViniWRY","deploymentId":"dpl_DGmhKsAzJdVqypJzon18vViniWRY","dynamics":[],"chunks":[]}