Build on Flow | Learn FCL - 12. How to Create a New Account with Flow CLI and Testnet Faucet
Tags: javascript, tutorial, onflow, blockchain
Published: 2022-06-28 20:19:22

## Overview

In previous posts we’ve covered how to setup your wallet with [Blocto](https://dev.to/maxstalker/build-on-flow-learn-fcl-10-how-to-create-a-new-testnet-account-with-blocto-wallet-4lda) and [Lilico](https://dev.to/onflow/build-on-flow-learn-fcl-11-how-to-install-and-create-a-new-testnet-account-with-lillico-18i). While it’s convenient to use those in the browser environment, you won’t be able to do it on server side. But it’s still possible to sign the transactions if you control the private key corresponding to a public key set on account.

So in this post will teach you how to:

- install [Flow CLI](https://docs.onflow.org/flow-cli/install/)
- [generate](https://docs.onflow.org/flow-cli/generate-keys/) private/public key pair using Flow CLI
- create new account using [Testnet Faucet](https://testnet-faucet.onflow.org/)

### Step 1 - Installation

First we will need to install Flow CLI. The process is pretty straightforward and explained in details here → [Flow Documentation - Install the Flow CLI](https://docs.onflow.org/flow-cli/install/).

After the installation is completed, you can check that it’s working properly by checking version of installed Flow CLI:

```bash
flow version
```

At the time of writing latest released version is `v0.36.1` and that’s what you should see in the terminal window:

```bash
% flow version
Version: v0.36.1
Commit: 5a1d7bfa90fb95ac3335d9c5ea214a6ef445759b
```

### Step 2 - Generate Key Pair

Next thing we need to generate key pair - `private` and `public` keys. We will use the former to sign transactions and the latter to attach to a newly created account, so we could control it.

The easiest way to generate fresh key pair is - *drum rolls 🥁* - Flow CLI! Boi, what a handy tool it is 🤩. Run this in your terminal:

```bash
flow keys generate
```

The output will be similar to this:

```bash
🙏 If you want to create an account on testnet with the generated keys use this link:
https://testnet-faucet.onflow.org/?key=95b37b7d759c09532ffbda33bcd65bd6826366fe0d518e1bdbead62a9e51a2f19db0fb4e0bbf0b4a35048437423fc87dfc00349096723d75c2e3bfbf2246895e 

🔴️ Store private key safely and don't share with anyone! 
Private Key 	 feca763f32039483394bf0b416c55fea7c9e07f43bc48ccf02de66a774346b49 
Public Key 	 95b37b7d759c09532ffbda33bcd65bd6826366fe0d518e1bdbead62a9e51a2f19db0fb4e0bbf0b4a35048437423fc87dfc00349096723d75c2e3bfbf2246895e
```

> ⛔ **Attention!** Do not share your private key with anyone. I’m showing you mine here for editorial purposes. But you should keep your private key in some safe place.
> 

> 🙈 Post-it note on your monitor is not safe place…
> 

> ⚠️ **Windows OS** have some issues with splitting the lengthy keys, so when you copy/paste it from your terminal ensure there is no extra space characters in the middle 😤
> 

You can copy that link Flow CLI created for you to pre-populate `Paste Your Public Key` or you can open [Flow Testnet Faucet](https://testnet-faucet.onflow.org/) and do it manually. Either way is OK 🙂

Keep `ECDSA_P256` for Signature Algorithm and `SHA3_256` for Hash Algorithm as those are used by CLI to prepare your keys. Then mark checkbox and pass CAPTCH test, confirming you are human (🤖 *got you, meat bags!*). Press `Create Account` and you are done! 🙌

![Faucet - Account](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v9aiigpv6u0svfhbxhz2.png)

Write that address down - better alongside private key 😉 -  cause we will need it for signing as well.

Congratulations! Now you are the owner of freshly baked Flow Testnet account! 💪

![https://media.giphy.com/media/5mTwWeN3MoS08/giphy.gif](https://media.giphy.com/media/5mTwWeN3MoS08/giphy.gif)

Until next time, my fluffy kittens! 👋 😸

## Resources

- Install Flow CLI - [https://docs.onflow.org/flow-cli/install/](https://docs.onflow.org/flow-cli/install/)
- Generate Key Pair - [https://docs.onflow.org/flow-cli/generate-keys/](https://docs.onflow.org/flow-cli/generate-keys/)
- Flow Testnet Faucet - [https://testnet-faucet.onflow.org/](https://testnet-faucet.onflow.org/)