How to Set Up Octopus Deploy on Windows Server 2012 R2
Octopus Deploy is a professional release management and deployment automation platform designed specifically for .NET and Windows environments. It provides deployment pipelines with environments, lifecycle policies, project-specific deployment processes, variable scoping by environment, and detailed deployment audit logging. Unlike Jenkins (which focuses on CI) or PowerShell scripts (which are imperative), Octopus Deploy manages the CD (continuous delivery) side with structured deployment promotion, approval workflows, and rollback capabilities. On Windows Server 2012 R2, Octopus Deploy Server runs as a Windows service and integrates naturally with the Windows toolchain. This guide covers installing Octopus Deploy Server, configuring the database, adding deployment targets (Tentacles), creating a project, and deploying a sample application.
Prerequisites
- Windows Server 2012 R2 with 4 GB+ RAM (8 GB recommended for active use)
- SQL Server (Express, Standard, or Enterprise) — SQL Server 2012 or later
- PowerShell 4.0
- .NET Framework 4.5.2 (included) or later
- Octopus Deploy license (free Community license for small teams, paid for larger deployments)
- Outbound internet access to download installers
Step 1: Install SQL Server Express (if needed)
Octopus Deploy requires a SQL Server database. If you do not have SQL Server available, install SQL Server 2014 Express:
Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/?LinkID=510033" -OutFile "C:TempSQLEXPR_x64_ENU.exe"
Start-Process -FilePath "C:TempSQLEXPR_x64_ENU.exe" -ArgumentList `
"/Q /IACCEPTSQLSERVERLICENSETERMS /ACTION=Install /INSTANCENAME=SQLEXPRESS",
"/FEATURES=SQLENGINE /SECURITYMODE=SQL /SAPWD=`"SQLPassword1!`"",
"/TCPENABLED=1 /NPENABLED=0" `
-Wait -PassThru
Write-Host "SQL Server Express installed"
Enable TCP/IP and allow remote connections to the SQL instance if Octopus is on a different server:
New-NetFirewallRule -DisplayName "SQL Server Express" -Direction Inbound -Protocol TCP -LocalPort 1433 -Action Allow
Step 2: Download and Install Octopus Deploy Server
$OctopusVersion = "2024.1.0"
$OctopusUrl = "https://download.octopusdeploy.com/octopus/Octopus.$OctopusVersion-x64.msi"
Invoke-WebRequest -Uri $OctopusUrl -OutFile "C:TempOctopus.msi"
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i C:TempOctopus.msi /quiet /norestart" -Wait -PassThru
Write-Host "Octopus Deploy Server installed"
Step 3: Configure Octopus Deploy Server
Use the Octopus command-line interface to configure the server. The Octopus Manager wizard can also be used via the GUI:
$OctopusExe = "C:Program FilesOctopus DeployOctopusOctopus.Server.exe"
# Create the Octopus instance
& $OctopusExe create-instance `
--instance "OctopusServer" `
--config "C:OctopusOctopusServer.config"
# Configure the database connection
& $OctopusExe database `
--instance "OctopusServer" `
--connectionString "Server=localhostSQLEXPRESS;Database=OctopusDeploy;Trusted_Connection=True;"
# Configure the master key (secure random key for encrypting secrets)
& $OctopusExe configure `
--instance "OctopusServer" `
--webForceSSL "false" `
--webListenPrefixes "http://localhost:8080/" `
--commsListenPort "10943"
# Create the admin account
& $OctopusExe admin `
--instance "OctopusServer" `
--username "admin" `
--email "[email protected]" `
--password "OctopusAdmin1!"
# Install and start the Windows service
& $OctopusExe service `
--instance "OctopusServer" `
--install `
--stop `
--start
Write-Host "Octopus Deploy Server configured and started"
Step 4: Open Firewall Rules
# Web UI port
New-NetFirewallRule -DisplayName "Octopus Web UI" -Direction Inbound -Protocol TCP -LocalPort 8080 -Action Allow
# Tentacle communication port (inbound on Listening Tentacle targets)
New-NetFirewallRule -DisplayName "Octopus Tentacle" -Direction Inbound -Protocol TCP -LocalPort 10933 -Action Allow
Step 5: Install and Configure an Octopus Tentacle
Octopus Tentacles are lightweight agents installed on deployment target servers. They accept deployment instructions from the Octopus Server and execute the deployment steps. Install a Tentacle on the target web server:
$TentacleUrl = "https://download.octopusdeploy.com/octopus/Octopus.Tentacle.2024.1.0-x64.msi"
Invoke-WebRequest -Uri $TentacleUrl -OutFile "C:TempTentacle.msi"
Start-Process -FilePath "msiexec.exe" -ArgumentList "/i C:TempTentacle.msi /quiet /norestart" -Wait
$TentacleExe = "C:Program FilesOctopus DeployTentacleTentacle.exe"
# Configure the Tentacle
& $TentacleExe create-instance --instance "Tentacle" --config "C:OctopusTentacle.config"
& $TentacleExe new-certificate --instance "Tentacle" --if-blank --console
& $TentacleExe configure --instance "Tentacle" --reset-trust --console
& $TentacleExe configure --instance "Tentacle" --home "C:Octopus" --app "C:OctopusApplications" --console
& $TentacleExe configure --instance "Tentacle" --port 10933 --console
# Register with the Octopus Server (replace with your server URL and API key)
& $TentacleExe register-with `
--instance "Tentacle" `
--server "http://octopus-server.domain.local:8080/" `
--apiKey "API-YOURAPIKEY" `
--role "web-server" `
--environment "Production" `
--name "$env:COMPUTERNAME" `
--console
# Install as a Windows service
& $TentacleExe service --instance "Tentacle" --install --stop --start
Write-Host "Tentacle installed and registered"
Step 6: Create an API Key
Generate an API key for scripted operations and Tentacle registration. Log into the Octopus web interface at http://octopus-server:8080, click your username in the top right, select Profile, then API Keys, and click New API Key. Store the key securely — it is only shown once.
Step 7: Create a Project and Deployment Process
Use the Octopus REST API to create a project programmatically:
$OctopusBaseUrl = "http://localhost:8080"
$ApiKey = "API-YOURAPIKEY"
$Headers = @{ "X-Octopus-ApiKey" = $ApiKey; "Content-Type" = "application/json" }
# Create a project group
$ProjectGroup = Invoke-RestMethod -Uri "$OctopusBaseUrl/api/projectgroups" -Method POST -Headers $Headers -Body (@{
Name = "Web Applications"
Description = "Customer-facing web applications"
} | ConvertTo-Json)
# Create the project
$Project = Invoke-RestMethod -Uri "$OctopusBaseUrl/api/projects" -Method POST -Headers $Headers -Body (@{
Name = "MyWebApp"
Description = "Main customer portal"
ProjectGroupId = $ProjectGroup.Id
LifecycleId = "Lifecycles-1" # Default lifecycle ID
} | ConvertTo-Json)
Write-Host "Project created: $($Project.Name) - ID: $($Project.Id)"
Step 8: Configure Environments and Lifecycle
In the Octopus web UI, navigate to Infrastructure > Environments and create your deployment environments in order: Development, Test, Staging, Production. Then navigate to Library > Lifecycles and create a lifecycle that progresses through these environments in order, with optional approvals before Production deployment.
Step 9: Verify the Setup
Get-Service "OctopusDeploy" | Select-Object Name, Status
Get-Service "OctopusDeploy Tentacle" | Select-Object Name, Status
# Check Octopus Server health via API
$health = Invoke-RestMethod -Uri "http://localhost:8080/api" -Headers $Headers
Write-Host "Octopus version: $($health.Version)"
Write-Host "Server status: $($health.Links.Self)"
Summary
Octopus Deploy Server is now running on Windows Server 2012 R2 with SQL Server Express as the backend database. Deployment targets have Tentacle agents installed and registered with the Octopus Server, enabling structured release deployment across Development, Test, Staging, and Production environments. The Octopus web interface provides complete visibility into deployment history, release promotion, and variable management, while the REST API enables integration with CI servers like Jenkins or GitHub Actions to trigger deployments automatically after successful builds. Octopus Deploy fills the critical gap between build automation and controlled production deployments in a professional Windows-centric CD pipeline.