Published on August 09, 2024By DeveloperBreeze

Tutorial: Installing Solana on Ubuntu

Introduction

Solana is a high-performance blockchain supporting fast transactions and low fees. Setting up a Solana node on your Ubuntu machine allows you to develop and deploy decentralized applications (dApps) on the Solana network. This tutorial will guide you through installing Solana on Ubuntu, from initial setup to verifying your installation.

Prerequisites

Before starting, ensure you have the following:

  • An Ubuntu machine (Ubuntu 20.04 LTS or later is recommended).

  • Basic knowledge of using the terminal.

  • An internet connection to download necessary packages.

Step 1: Update Your System

First, update your system's package list to ensure you have the latest versions of all packages and dependencies.

Open your terminal and run the following commands:

sudo apt update
sudo apt upgrade -y

Step 2: Install Required Dependencies

Solana requires several dependencies to be installed on your system. Use the following commands to install them:

sudo apt install -y curl git build-essential libssl-dev pkg-config

  • curl: A tool for transferring data with URLs.

  • git: A version control system for tracking code changes.

  • build-essential: A package containing essential development tools.

  • libssl-dev: A library for Secure Sockets Layer (SSL) and Transport Layer Security (TLS).

  • pkg-config: A helper tool used when compiling applications and libraries.

Step 3: Install Rust

Solana is built with Rust, so you need to install Rust and its associated tools using the Rust installation script:

    • Download and run the Rust installation script:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
   

    • Follow the on-screen instructions:

- When prompted, press 1 to proceed with the default installation.

- Once installation is complete, configure your current shell session to use Rust:

source $HOME/.cargo/env
   

    • Verify the Rust installation:

rustc --version
   

You should see the Rust version printed in the terminal.

Step 4: Install Solana Command-Line Tools

With Rust installed, you can now install the Solana command-line tools. These tools are essential for interacting with the Solana network.

    • Clone the Solana GitHub repository:

git clone https://github.com/solana-labs/solana.git
   

    • Navigate to the Solana directory:

cd solana
   

    • Checkout the latest stable release:

git checkout v1.16.10
   

Replace v1.16.10 with the latest stable version if a newer version is available.

    • Build the Solana tools:

cargo build --release
   

    • Add Solana tools to your PATH:

export PATH="$HOME/solana/target/release:$PATH"
   

To make this change permanent, add the above line to your ~/.bashrc or ~/.zshrc file and source it:

echo 'export PATH="$HOME/solana/target/release:$PATH"' >> ~/.bashrc
   source ~/.bashrc
   

Step 5: Verify the Solana Installation

After installing Solana, you can verify the installation by checking the version of the Solana command-line tools:

solana --version

You should see the Solana version number printed in the terminal, indicating a successful installation.

Step 6: (Optional) Configure Solana CLI

You can further configure the Solana CLI for specific networks (e.g., Mainnet, Devnet, Testnet). By default, Solana uses the Devnet:

    • Set the cluster to Mainnet:

solana config set --url https://api.mainnet-beta.solana.com
   

    • Set the cluster to Devnet (default):

solana config set --url https://api.devnet.solana.com
   

    • Set the cluster to Testnet:

solana config set --url https://api.testnet.solana.com
   

Conclusion

Congratulations! You have successfully installed Solana on your Ubuntu system. You are now ready to interact with the Solana blockchain, whether for development, deploying dApps, or running a validator node. Explore the Solana documentation to learn more about its capabilities and start building your applications on this high-performance blockchain.

Solana's speed and low transaction costs make it an attractive platform for developers looking to create scalable and efficient blockchain applications. Enjoy building on Solana!

Comments

Please log in to leave a comment.

Continue Reading:

Creating a Token on Solana

Published on August 09, 2024

bashrust

Building a Simple Solana Smart Contract with Anchor

Published on August 09, 2024

javascriptbashrustnodejs

Fetching Address Details from Solana

Published on August 09, 2024

javascriptjson

Tracking Newly Created Tokens on Ethereum

Published on August 09, 2024

javascriptnodejs

Tracking Newly Created Tokens on Solana

Published on August 09, 2024

javascriptnodejs

Tracking Solana Address for New Trades and Amounts

Published on August 09, 2024

javascriptnodejs