Skip to content
Follow
Ubuntu Linux

How to Install Swift on Ubuntu 24.04

Richard
Written by
Richard
Dec 18, 2024 Updated Sep 15, 2026 3 min read
How to Install Swift on Ubuntu 24.04
How to Install Swift on Ubuntu 24.04

Installing Swift on Ubuntu 24.04 lets you run Apple’s programming language on Linux version 24.04 for server backends and mobile apps. Swift is a free coding language that handles software development directly on your Linux desktop or server with a few terminal commands.

Advertisement
⚡ Quick Answer

Install Swift on Ubuntu 24.04 by first installing prerequisite packages using apt. Then, download the Swift toolchain binary from the official Swift website, verify its signature, extract it to /opt, and add Swift’s bin directory to your PATH.

Advertisement

Prepare Ubuntu

To install Swift Ubuntu 24.04 safely, you need to check your exact system version first to avoid compatibility errors. Open your terminal and run the lsb_release -a command to confirm you are running the correct noble release before you download any files.

Download the appropriate release package matching the target environment architecture.

Run the command to verify the Ubuntu release and codename of your system.

lsb_release -a

Systems running Ubuntu 24.04 return release version 24.04 alongside the noble codename.

Fetch the required dependency packages using the system package manager.

Advertisement
sudo apt-get install binutils git gnupg2 libc6-dev libcurl4-openssl-dev libedit2 libgcc-13-dev libncurses-dev libpython3-dev libsqlite3-0 libstdc++-13-dev libxml2-dev libz3-dev pkg-config tzdata unzip zlib1g-dev

Download Swift

To install Swift Ubuntu 24.04 successfully, you need to download the official release binary using the wget file retrieval tool. Run the wget command in your terminal to fetch the latest package directly from the Swift download site and match your system architecture.

The command below downloads Swift 6.0.3 binary; remember to replace the version number with the latest.

wget https://download.swift.org/swift-6.0.3-release/ubuntu2404/swift-6.0.3-RELEASE/swift-6.0.3-RELEASE-ubuntu24.04.tar.gz

Grabbing the GPG key (a cryptographic signature used to verify package authenticity) secures the installation process. Run this command:

Download the Swift signature file for the installer, and then use the command below to verify it, ensuring the downloaded file is genuine.

Advertisement
wget https://download.swift.org/swift-6.0.3-release/ubuntu2404/swift-6.0.3-RELEASE/swift-6.0.3-RELEASE-ubuntu24.04.tar.gz.sig
gpg --verify swift-6.0.3-RELEASE-ubuntu24.04.tar.gz.sig

Extract the downloaded installer archive and move the resulting folder into the /opt directory.

tar xzf swift-6.0.3-RELEASE-ubuntu24.04.tar.gz
sudo mv swift-6.0.3-RELEASE-ubuntu24.04/* /opt/swift

Configure Swift

To make the compiler work from any terminal window when you install Swift Ubuntu 24.04, you must add the installation folder to your system PATH variable. Run the echo command to update your profile and load the new settings immediately without restarting your computer.

echo "export PATH=$PATH:/opt/swift/usr/bin" >> $HOME/.profile
source $HOME/.profile

Executing the command below confirms the compiler binary responds correctly.

swift --version

The terminal outputs the specific compiler version currently active in the environment.

Advertisement

Launching the interactive read-eval-print loop starts the Swift REPL environment.

swift

That completes the setup process.

Conclusion:

Installing Swift on Ubuntu 24.04 provides a powerful tool for cross-platform development. Key benefits include:

Advertisement
  • Versatility: Swift allows for developing applications across multiple operating systems, enhancing your ability to reach a broader audience.
  • GPG Key Security: Downloading and verifying the Swift GPG key ensures the integrity and authenticity of your installation.
  • Easy Installation: The installation process is straightforward, making it accessible for developers of all experience levels.
  • Path Configuration: Properly setting the command PATH is essential for utilizing Swift commands seamlessly in your terminal.
  • Ready for Development: Swift is instantly available to develop robust applications in a Linux environment after installation.

Completing these configuration steps expands the local development toolkit with Apple's modern programming language on Linux.

Where to install Swift?

The best place to install Swift on Ubuntu 24.04 is directly from the official Swift.org install page, which provides the most up-to-date instructions and toolchains.

Can Swift be installed on Linux?

Swift.org provides download packages for Ubuntu 16.04, Ubuntu 18.04, Ubuntu 20.04, CentOS 7, CentOS 8, and Amazon Linux 2. Other distributions also have official support, such as Fedora, Red Hat Enterprise Linux 8, Raspbian OSi, etc.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

Advertisement

📚 Related Tutorials

How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04
How to Install i-doit on Ubuntu with Apache (Free IT Asset)
CMS How to Install i-doit on Ubuntu with Apache (Free IT Asset)
How to Install Ubuntu Linux
Ubuntu Linux How to Install Ubuntu Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *