Stay organized with collections Save and categorize content based on your preferences.
Microsoft SQL Server is a database system that runs on Windows Server and some Linux distributions. You can use SQL Server on Compute Engine as part of the backend for your applications, as a flexible development and test environment, or in addition to your on-premises systems for backup and disaster recovery.
Compute Engine provides images with Microsoft SQL Server preinstalled on Windows Server. For these SQL Server images, Compute Engine manages the license for both Windows Server and SQL Server, and includes the cost in your monthly bill. Create VMs with SQL Server and scale out to large multi-node configurations when you need them.
Compute Engine stores your data on durable persistent disks with automatic redundancy and automatic encryption at rest. Use these persistent disks to store your SQL Server data without having to worry about the durability or security of your data. For additional performance, create your VMs with a local SSD as a cache that provides additional IOPS and performance for SQL Server queries.
You can create Compute Engine virtual machine (VM) instances that run SQL Server in the following ways:
Creating a VM using a SQL Server image. These images include one of several SQL Server editions that run on Windows Server. You can use these images to run SQL Server on Compute Engine without obtaining your own separate license from Microsoft.
Migrating your existing SQL Server licenses to a Windows Server VM on Compute Engine and manage those licenses yourself.
For a full list of the available images that include SQL Server preinstalled, see Operating system details.
Machine type requirements for SQL Server imagesThe best machine type for SQL Server depends on the edition of SQL Server that you're running.
SQL Server StandardYou can run SQL Server Standard on VMs with any machine type, but shared-core machine types won't run optimally. Google recommends that you use VMs with at least one vCPU to run SQL Server Standard.
SQL Server EnterpriseVMs that run SQL Server Enterprise must have at least 4 vCPUs. For optimal performance, Google recommends that you run SQL Server Enterprise on VMs with larger memory capacities. Depending on your workload, you should use highmem
predefined machine types with 8 vCPUs or more, such as for N2. The highmem
predefined machine types maximize the ratio of memory to each vCPU that is available on Compute Engine, which is optimal for SQL Server Enterprise VMs.
Additionally, you can use SQL Server Enterprise on Compute Engine to create SQL Server Availability Groups.
Default componentsSQL Server images include several components by default. The default components depend on the edition of SQL Server that you selected.
For information about the default components included with your version of SQL Server, see Editions and supported features of SQL Server 2019.
For information about modifying the SQL Server components, see Add Features to an Instance of SQL Server.
Before you beginSelect the tab for how you plan to use the samples on this page:
ConsoleWhen you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloudInstall the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.To use the Terraform samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
RESTTo use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
For more information, see Authenticate for using REST in the Google Cloud authentication documentation.
To create a SQL Server instance, specify the image family for the specific version of SQL Server that you need. For a list of the SQL Server image families, see Operating system details.
For optimal performance, database server platforms require machine types with more virtual CPUs and larger amounts of memory. Google recommends that you use machine types with at least 2 vCPUs and at least 4 GB of memory when you run SQL Server instances. You can use custom machine types to configure SQL Server instances to match the performance requirements for your workload. Additionally, you can use larger persistent disks and faster SSD persistent disks to improve the performance of your applications.
Additionally, you must set specific firewall rules to allow SQL Server traffic on the VPC network or subnet that your VM is a part of. For more information see Best practices for SQL Server.
ConsoleTo create a SQL Server instance, follow these steps:
In the Google Cloud console, go to the Create an instance page.
Specify the VM details.
In the Boot disk section, click Change, and then do the following:
Click Create.
After you create the VM, create a firewall rule to allow access to SQL Server on your VM. The default SQL Server port is 1433.
In the Google Cloud console, go to the Firewall Rules page.
At the top of the page, click Create firewall rule to start creating a firewall rule.
Specify the details for this firewall rule.
1433
, which is the default port.Click Create to create this firewall rule and allow access to your SQL Server instance over port 1433.
If you need to add additional firewall rules to your VM, see the firewall rules documentation.
gcloudUse the compute images list
command to see a list of available SQL Server images:
gcloud compute images list --project windows-sql-cloud --no-standard-images
Use the compute instances create
command to create a new VM and specify the image family for one of the Windows Server or SQL Server public images.
gcloud compute instances create VM_NAME \ --image-project windows-sql-cloud \ --image-family IMAGE_FAMILY \ --machine-type MACHINE_TYPE \ --boot-disk-size BOOT_DISK_SIZE \ --boot-disk-type BOOT_DISK_TYPE
Replace the following:
pd-balanced
.After you create the VM, create a firewall rule to allow access to SQL Server on your VM. The default SQL Server port is 1433.
gcloud compute firewall-rules create sql-server-1433 \ --description "Allow SQL Server access from all sources on port 1433." \ --allow tcp:1433 --network NETWORK
where NETWORK is the name of the VPC network where your VM is located.
If you need to add additional firewall rules to your VM, see the firewall rules documentation.
TerraformTo create the SQL Server VM instances, use the google_compute_instance
resource.
To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.
RESTTo create a VM with the API, include the initializeParams
property in your VM creation request and specify a Windows image.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/instances instance = { "name": "VM_NAME", "machineType": "zones/ZONE/machineTypes/MACHINE_TYPE", "disks": [{ "boot": "true", "type": "PERSISTENT", "initializeParams": { "diskName": "DISK_NAME", "sourceImage": "projects/IMAGE_PROJECT/global/images/family/IMAGE_FAMILY", "diskSizeGb": "BOOT_DISK_SIZE", "diskType": "BOOT_DISK_TYPE", } }], "networkInterfaces": [{ "accessConfigs": [{ "type": "ONE_TO_ONE_NAT", "name": "External NAT" }], "network": "global/networks/default" }], "serviceAccounts": [{ "email": DEFAULT_SERVICE_EMAIL, "scopes": DEFAULT_SCOPES }] }
Replace the following:
windows-cloud
for Windows Server images or windows-sql-cloud
for Windows Server images with SQL Server preinstalled.pd-ssd
.After you create the VM, use the firewalls.insert
method to create a firewall rule that allows access to SQL Server on your VM. The default SQL Server port is 1433
.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/firewalls { "name": "sql-server-1433", "network": "global/networks/NETWORK", "allowed": [ { "IPProtocol": "tcp", "ports": [ "1433" ] } ] }
Replace the following:
After you create your SQL Server instance, set the initial password for the VM so that you can connect to the VM through RDP. Then, run the SQL Server Management Studio as an administrator to manage databases on your SQL Server instance.
Additionally, you can enhance the SQL Server installation with one or more of the following items:
c:\sql_server_install\setup.exe
.c:\sql_server_install\setup.exe
installer and select a new installation path on your secondary disk.Run the SQL Server Management Studio as an administrator to configure SQL Server databases. You can download and install the SQL Server Management Studio on your local workstation, and use it to remotely connect to the database engine on your VM.
If you can't install the Management Studio on your local workstation, connect to the VM through RDP and run the Management Studio on the VM itself. SQL Server 2012 and SQL Server 2014 both include the SQL Server Management Studio by default. For SQL Server 2016, you must download the SQL Server Management Studio from the Microsoft website and install it on the VM.
By default, SQL Server uses Windows Authentication mode to control remote access to SQL Server itself. If you need to use SQL Server Authentication mode, change the authentication mode.
Manually updating SQL Server instance namesIf you rename a VM that hosts SQL Server, you must update the SQL Server instance name. For more information, see Rename a computer that hosts a stand-alone instance of SQL Server.
What's nextExcept 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 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["Compute Engine offers pre-installed Microsoft SQL Server images on Windows Server, managing both Windows Server and SQL Server licenses, with costs included in the monthly bill."],["You can create SQL Server instances on Compute Engine using pre-configured images, migrating existing licenses, or installing SQL Server on a Linux VM, giving you multiple options."],["For optimal performance, SQL Server Standard should be run on VMs with at least one vCPU, while SQL Server Enterprise requires a minimum of 4 vCPUs and benefits from `highmem` predefined machine types with larger memory capacities."],["Compute Engine stores SQL Server data on durable persistent disks with automatic redundancy and encryption, and local SSDs can be added as a cache to improve IOPS and query performance."],["To access your SQL Server instance after creation, a firewall rule must be configured to allow traffic on port 1433, which is the default port."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4