Install TeamCity Server on Linux or macOS
Download TeamCity Server
Go to the JetBrains website and download the .tar.gz distribution with the "portable" version of the TeamCity server.
Or, you can run it from a Docker image. See Server Docker Images.
Specifics of the .tar.gz distribution:
It includes a Tomcat version tested to work fine with the respective version of TeamCity. You can use an alternative Tomcat version, but other combinations are not guaranteed to work correctly.
It is possible to configure the installation by changing the startup script and JRE options.
It comes bundled with a build agent distribution and a startup script which allows for easy TeamCity server evaluation with one agent.
It comes bundled with the devPackage for the TeamCity plugin development.
Install from tar.gz
We recommend running the TeamCity server under a dedicated user account.
To install the server, unpack the TeamCity<version number>.tar.gz archive. Use the tar xfz TeamCity<version number>.tar.gz command on Linux, or WinZip, WinRAR, or a similar utility on Windows.
Make sure a JRE or JDK is installed and that the JAVA_HOME environment variable points to the Java installation directory. See recommended Java versions.
Example: Installation using Ubuntu Linux
Create a dedicated user account called
teamcityto run TeamCity.root@ubuntu:/# adduser teamcityInstall
wgetto download tar.gz files.root@ubuntu:/# apt update && apt install wget -yDownload the Linux tar.gz file from the TeamCity Downloads Page.
# Switch to the /opt directory, where TeamCity will be unpacked root@ubuntu:/# cd /opt # Download the tar.gz file using wget root@ubuntu:/opt# wget https://download.jetbrains.com/teamcity/TeamCity-<version>.tar.gzUnpack the tar.gz file.
root@ubuntu:/opt# tar xfz TeamCity-<version>.tar.gzEnsure a compatible Java is installed or the
JAVA_HOMEenvironment variable stores the correct path to Java.root@ubuntu:/opt# java -version root@ubuntu:/opt# echo $JAVA_HOMEIf no compatible Java is installed, install it like follows (the following example installs the Amazon Corretto 21 Java):
root@ubuntu:/opt# apt install java-common -y root@ubuntu:/opt# wget https://corretto.aws/downloads/latest/amazon-corretto-21-x64-linux-jdk.deb root@ubuntu:/opt# dpkg --install amazon-corretto-21-x64-linux-jdk.deb # verify the installation root@ubuntu:/opt# java -version openjdk version "21.0.18" 2025-01-17 LTS OpenJDK Runtime Environment Corretto-21.0.18.10.1 (build 21.0.18+10-LTS) OpenJDK 64-Bit Server VM Corretto-21.0.18.10.1 (build 21.0.18+10-LTS, mixed mode)Change the owner of the /opt/TeamCity directory to the
teamcityuser created in step 1.root@ubuntu:/opt# chown -R teamcity:teamcity TeamCitySwitch to the
teamcityuser.root@ubuntu:/opt# su teamcity teamcity@ubuntu:/opt$Start the TeamCity server and its bundled build agent.
teamcity@ubuntu:/opt$ TeamCity/bin/runAll.sh start Spawning TeamCity restarter in separate process TeamCity restarter running with PID 2817 Starting TeamCity build agent... Java executable is found: '/usr/lib/jvm/java-21-amazon-corretto/bin/java' Starting TeamCity Build Agent Launcher... Agent home directory is /opt/TeamCity/buildAgent Done [3230], see log at /opt/TeamCity/buildAgent/logs/teamcity-agent.logNavigate to
<ip address>:8111in a web browser to complete the installation (see TeamCity First Start).
Automatic Server Startup
See this article for the instructions: Start TeamCity Server.