Start or stop an SFTP server

You can stop or start an SFTP server to manage its state, control access, and help optimize costs.

Stopping a server disables access and reduces resource usage. For example, if you suspect unauthorized access to a server, you can halt all active transfers and block new connections by stopping the server. As another example, you can reduce server uptime costs by pausing a server during periods when no data transfers are expected.

When you start a server, access is restored and users can connect to the server.

Required roles

To get the permission that you need to start or stop an SFTP server, ask your administrator to grant you the Cloud FTP Admin (roles/ftp.admin) IAM role on your project. For more information about granting roles, see Manage access to projects, folders, and organizations.

This predefined role contains the ftp.servers.update permission, which is required to start or stop an SFTP server.

You might also be able to get this permission with custom roles or other predefined roles.

Stop a server

When you stop a server, the following things happen:

  • Access is denied and active connections are dropped. Users who have an active connection might see an error message like the following:

    Connection is terminated: Connection closed by remote host
    client_loop: send disconnect: Broken pipe
    Connection closed
    
  • No new connections can be established.

To stop a server, use the following steps.

REST

To stop a server, use the servers.stop method.

Before using any of the request data, make the following replacements:

  • PROJECT_ID: the Google Cloud project ID of the server.
  • LOCATION_ID: the Google Cloud location of the server, such as us-west1.
  • SERVER_ID: the server ID.

HTTP method and URL:

POST https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID:stop

To send your request, expand one of these options:

curl (Linux, macOS, or Cloud Shell)

Execute the following command:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID:stop"

PowerShell (Windows)

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID:stop" | Select-Object -Expand Content
The response identifies a long-running operation.

Start a server

REST

To start a server, use the servers.start method.

Before using any of the request data, make the following replacements:

  • PROJECT_ID: the Google Cloud project ID of the server.
  • LOCATION_ID: the Google Cloud location of the server, such as us-west1.
  • SERVER_ID: the server ID.

HTTP method and URL:

POST https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID:start

To send your request, expand one of these options:

curl (Linux, macOS, or Cloud Shell)

Execute the following command:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID:start"

PowerShell (Windows)

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://ftp.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/servers/SERVER_ID:start" | Select-Object -Expand Content
The response identifies a long-running operation. It takes a few minutes for the server to start.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026年08月26日 UTC.