PHASE 3 OF 15

Projects & Project Hierarchy

Organise your TeamCity server with projects and subprojects, create projects from VCS URLs, configure shared parameters and connections, and manage the project lifecycle

ProjectsHierarchyParametersVCS Roots
1

Root Project & Project Hierarchy

Every TeamCity server has a single Root Project at the top. All other projects descend from it. Projects can be nested to any depth to match your organisation's structure.

Root Project // Cannot be deleted; global settings live here ├── Techoral // Organisation-level project │ ├── Backend Services // Team or product area │ │ ├── user-service // Single microservice │ │ │ ├── Build // Build configuration │ │ │ ├── Test │ │ │ └── Deploy-Staging │ │ └── order-service │ └── Frontend │ └── web-app └── Infrastructure // Another top-level project
Inheritance rules

Settings defined at a higher level are inherited by all descendants:

  • VCS Roots — define once on a parent project, use in any child build config
  • Parameters — parent project params are available in all child configs
  • Connections — GitHub OAuth connections, cloud profiles defined on parent
  • Clean-up rules — parent rules apply to all children unless overridden
  • Templates — available to all configs in the same project or descendants
2

Creating a Project from VCS

The fastest way to create a project is from a repository URL — TeamCity auto-detects the build tool and creates starter build configurations.

  1. Go to Administration → Projects and click Create project.
  2. Select From repository URL.
  3. Enter your GitHub repository URL: https://github.com/yourorg/yourrepo.git
  4. Enter credentials (username + personal access token, or leave blank for public repos).
  5. Click Proceed. TeamCity fetches the repo, scans for build files (pom.xml, build.gradle, etc.), and suggests build configurations.
  6. Review the auto-detected steps, adjust if needed, and click Use suggested settings.
AUTO-DETECTION

TeamCity's auto-detection works well for Maven, Gradle, MSBuild, Ant, and Rake projects. It scans the root and one level deep for build files. For complex multi-module projects or custom build scripts, it's faster to create the project manually and add build steps by hand.

3

Project Settings

Every project has a settings page (Administration → <Project> → Edit Project Settings) with these tabs:

TabWhat it configures
General SettingsProject name, description, project ID (used in REST API and DSL). The project ID cannot be changed after creation without breaking references.
VCS RootsRepository connections shared across all build configs in this project. See Phase 5.
ParametersProject-level configuration parameters, system properties, and environment variables inherited by all child configs.
ConnectionsOAuth/credentials for external services: GitHub, Bitbucket, Docker Registry, cloud providers. Referenced in VCS Roots and build features.
Build ConfigurationsList and manage all build configs inside this project.
SubprojectsList child projects. Create or move subprojects here.
Clean-upHow long to keep builds, artifacts, and statistics.
Versioned SettingsSync project config to/from VCS (Kotlin DSL). See Phase 11.
Project ID

The project ID is auto-generated from the name (e.g., project name "Backend Services" → ID BackendServices). It is used in:

  • REST API URLs: /app/rest/projects/id:BackendServices
  • Kotlin DSL: project("BackendServices") { ... }
  • Dependency parameter references: dep.BackendServices_UserService_Build.param
GOTCHA — Project ID is permanent

Once a project is created, its ID appears in REST API URLs, Kotlin DSL, and parameter references across many build configs. Renaming the project changes the display name but NOT the ID. To change the ID you must edit the XML config directly — which can break references. Plan your naming conventions before creating projects.

4

Project-Level Parameters & Connections

When to define parameters at project level

Any value used by multiple build configs in a project should be a project parameter rather than duplicated in each config. Common examples:

  • env.NEXUS_URL — artifact repository URL used in all Maven builds
  • env.DOCKER_REGISTRY — registry URL used in Docker push steps
  • system.maven.settings.file — path to shared Maven settings.xml
  • env.DEPLOY_TARGET — staging server hostname

Go to Administration → <Project> → Parameters and click Add new parameter. Set the kind (Configuration parameter / System property / Environment variable), name, and value.

Connections (GitHub OAuth)

A GitHub connection lets TeamCity authenticate with GitHub using OAuth rather than storing a personal access token in each VCS Root. To set up:

  1. Go to Administration → <Project> → Connections → Add Connection.
  2. Select GitHub.com.
  3. Enter a GitHub OAuth App's Client ID and Client Secret.
  4. Copy the callback URL shown and add it to your GitHub OAuth App settings.
  5. Save. Now VCS Roots and build features in this project can use "GitHub.com (OAuth)" as their connection.
5

Subprojects — When & Why

ScenarioUse subproject?Reason
Multiple microservices owned by same teamYesOne parent project per team; one subproject per service. Shared team-level params live on parent.
Separate prod vs staging build configsNoUse one project with multiple build configs (Build, Deploy-Staging, Deploy-Prod).
Different permission boundaries (team A vs team B)YesPer-project permissions. Make team A admin of their subproject without affecting team B.
Monorepo with multiple appsYes (optional)One subproject per app; shared VCS root on parent. Clean separation in UI.

To create a subproject: go to Administration → <Parent Project> → Subprojects → Create subproject.

6

Project IDs & REST API Locators

In the TeamCity REST API (covered in depth in Phase 14), projects are addressed by their ID or internal ID:

# List all projects
GET /app/rest/projects

# Get a specific project
GET /app/rest/projects/id:BackendServices

# Get by name
GET /app/rest/projects/name:Backend%20Services

# Get internal ID (needed for some operations)
GET /app/rest/projects/id:BackendServices
# Returns: {"id":"BackendServices","internalId":"project12", ...}

The project ID is the human-readable string you set at creation. The internal ID is a server-assigned projectN string. Use the project ID in all your scripts — it's stable and readable.

7

Archiving & Deleting Projects

Archiving (soft disable)

Archiving a project stops all builds and triggers, hides it from the default project list, but retains all history, artifacts, and configuration. Good for repos that are deprecated but may need historical reference.

Go to Administration → <Project> → Actions → Archive project. To restore, find it in the archived projects list and click Dearchive.

Deleting (permanent)

Deletes the project, all subprojects, all build configurations, all build history, and all artifacts permanently. Cannot be undone (except from a server backup).

GOTCHA — Deleting removes artifacts

If other build configurations have artifact dependencies on the project you're deleting, those dependencies will break silently. TeamCity does not warn you about downstream artifact consumers. Audit artifact dependencies before deleting any project.

8

Copying & Moving Build Configurations

Copying a build configuration

Go to Administration → <Build Config> → Actions → Copy build configuration. Optionally copy to a different project. Useful for creating a new service from an existing one — copy the template config and update the VCS Root and parameters.

Moving a build configuration

Go to Administration → <Build Config> → Actions → Move to project. Moving updates the internal project ID prefix on the build config ID. All build history moves with it. Snapshot and artifact dependencies remain intact as long as the target project has access to the same VCS roots.

BEST PRACTICE — Templates over copying

If you find yourself copying build configurations frequently, switch to build configuration templates (Phase 11). Templates propagate changes to all configs at once — a copy is a snapshot that immediately diverges.

Up Next — Phase 4: Build Configurations & Build Steps

Learn the anatomy of a build configuration, all runner types (Maven, Gradle, CLI, PowerShell), step execution policies, failure conditions, artifact path patterns, and build number formats.

Continue to Phase 4 → Back to Hub