# Deploying Starknet smart contract **Published by:** [Vitamine](https://paragraph.com/@vitamine777/) **Published on:** 2023-02-06 **URL:** https://paragraph.com/@vitamine777/deploying-starknet-smart-contract ## Content Let's use the tool we used before - Gitpod. We need to upgrade Ubuntu to version 22. Here we gosudo apt list --upgradable sudo apt update && sudo apt upgrade -y sudo apt-get install ufw sudo ufw enable sudo ufw allow 1022/tcp sudo ufw reload sudo apt install update-manager-core -y sudo do-release-upgrade -dAfter this command, a long installation will begin.Press Enter when neededType Y and press EnterType Y and press EnterPress EnterNow let's install the components needed to deploy a smart contractcurl -L https://raw.githubusercontent.com/software-mansion/protostar/master/install.sh | bash source /home/gitpod/.bashrc protostar -vIf you have done everything correctly, this message will appearContinue.protostar initType N and press Etner. Then enter a folder name (any).cd [YOUR FOLDER NAME]protostar buildNow create a .env file in your folder.We will use the ArgentX. Copy the private key and paste it into the .env file (the gear at the top right and click on the name of the account).Important! We need to have at least 1 transaction in the network in which we will deploy the contract to continue (testnet or mainnet). Continue. We will be deploying the contract in mainnet. If you want to do this on a test network, just replace the ends of the following 2 commands "mainnet >>> testnet".protostar declare ./build/main.json --account-address [YOUR_WALLET_ADDRESS] --max-fee auto --private-key-path ./.env --network mainnetSave the data (just in case)Go to explorer (transaction hash) and wait for confirmation in L2.Continueprotostar deploy [CLASS_HASH] --account-address [YOUR_WALLET_ADDRESS] --max-fee auto --private-key-path ./.env --network mainnetTake CLASS_HASH from the previous result.The transaction costs a few centsCongratulations, you have deployed a smart contract! The last command may give an error. This is normal. This is Starknet. Enter the command until it works, you can wait 5-10 minutes. ## Publication Information - [Vitamine](https://paragraph.com/@vitamine777/): Publication homepage - [All Posts](https://paragraph.com/@vitamine777/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@vitamine777): Subscribe to updates - [Twitter](https://twitter.com/nlabplay): Follow on Twitter