# Deploying SUI smart contract on devnet

By [Vitamine](https://paragraph.com/@vitamine777) · 2023-01-25

---

I will do all the necessary steps on Ubuntu. We have two options: easy (my guide) and not so easy (server rental). We will go the simple way. For this one, you must have a [**Github**](https://github.com/) account.

Create a new repository and name it "**Hello SUI**", for example.

![](https://storage.googleapis.com/papyrus_images/78fc3fb6fa5cfaa219a2240cc2a6bf69b6d7092940b0c02ba263afce4e09a811.jpg)

After creating the repository, go to this site

[https://www.gitpod.io/](https://www.gitpod.io/)

and log in with our Github profile.

Next, create a new workspace and select our created repository.

![](https://storage.googleapis.com/papyrus_images/fb02015f9364ea600706de8719d52987e30cad185782aa190e40c20bd5612b31.jpg)

The terminal opens (the Get started window at the top can be closed).

![](https://storage.googleapis.com/papyrus_images/2e0c6c66986f6bf1e3ffbfaf2591e9f3931a851f2c67e91db1c958cda8e10619.jpg)

We need to install all the necessary components to deploy a smart contract.

Now paste the commands one by one into the terminal and click Enter (**to paste the copied text into the terminal right-click**).

> sudo apt-get update
> 
> sudo apt install curl -y
> 
> sudo apt-get install git-all -y
> 
> sudo apt install cmake -y
> 
> dpkg -L cmake
> 
> sudo apt-get install libssl-dev
> 
> sudo apt-get install libclang-dev -y
> 
> curl --proto '=https' --tlsv1.2 -sSf [https://sh.rustup.rs](https://sh.rustup.rs/) | sh

**Type 1 and press Enter**

> cargo install --locked --git [https://github.com/MystenLabs/sui.git](https://github.com/MystenLabs/sui.git) --branch devnet sui

**This part takes a very long time to install. Just waiting.**

Continue.

> echo $PATH
> 
> cargo install --git [https://github.com/move-language/move](https://github.com/move-language/move) move-analyzer --features "address20"
> 
> sui client

Type next: 1) **y** and press **Enter**, 2) then **just press Enter**, 3) then type **0** and press **Enter**

![](https://storage.googleapis.com/papyrus_images/d6c6c31deb2b394bde7880f83bd64279d68b53fbdfaf43ddb4136f4273e1a590.jpg)

Continue.

> sui client new-address ed25519

![](https://storage.googleapis.com/papyrus_images/bb34790fe1a4c135c310ec949eb362fdf13463b9651b31b3a31302f7eb3716b0.jpg)

A wallet was created. Save the seed phrase and address to a text file.

We need to request test tokens to this wallet. There are several ways

*   Request tokens in SUI discord to our address.
    
*   Transfer some test tokens from another wallet.
    
*   Import the seed phrase into one of the SUI wallets (SUI wallet, Suiet etc) and request tokens in it.
    
    Continue.
    
    > sui client switch --address \[ADDRESS\]
    
    replace \[ADDRESS\] with the address obtained from the previous command
    

![](https://storage.googleapis.com/papyrus_images/b166a551b6cd970d6ee451b8863d510be0cd2c42e8fc6ea9420b67b0c6ab0350.jpg)

Continue.

> sui move new forge

Created a **forge** folder with an empty **source** folder and a **Move.toml** file

Go to the **source** folder and create the file **forge.move**

![](https://storage.googleapis.com/papyrus_images/7fab7c2c9056c707fbe5eb6d77e683fe91623c7a23e26d587aaecf1bdbb5ddb5.jpg)

Go here

[https://github.com/Salvatorenodes/Hello-SUI/blob/main/example.move](https://github.com/Salvatorenodes/Hello-SUI/blob/main/example.move)

copy the code and paste the code into the **forge.move** file

![](https://storage.googleapis.com/papyrus_images/c69f87dd1437b755f89b61e5fa083111fbf2507b1910d01058d864cff5c7ce18.jpg)

Continue.

> cd forge
> 
> sui client publish --gas-budget 1000

![](https://storage.googleapis.com/papyrus_images/12eeeefc7fed835afecdb5592b18fafe7bda0d9567f65e43aa27ab1e19d41139.jpg)

Congratulations, you have deployed a smart contract! Save everything that goes into **Created ojects.**

Go to Sui explorer and search for your contract by typing the ID from **Created objects**.

[https://explorer.sui.io/](https://explorer.sui.io/)

---

*Originally published on [Vitamine](https://paragraph.com/@vitamine777/deploying-sui-smart-contract-on-devnet)*
