So you want to create a "secure" bitcoin wallet, but aren't sure of how to do that. Not a problem! This tutorial will guide you through the process of creating a secure wallet with which you can send, receive, and safely store your bitcoins. Before we get too far down the rabbit hole, make sure you've got a USB flash drive with at least 4 GB of space.

Step 1: Download Ubuntu

You can download the latest release of Ubuntu here. You will be downloading an ISO file, which is an archive of an optical disc. You could use this file to create a CD/DVD, or there are programs that can directly mount an ISO as if it were a physical CD/DVD in your computer's CD/DVD drive. We're going to be using this file to create a bootable USB flash drive.

Step 2: Verify the Ubuntu ISO

After you have finished downloading the Ubuntu ISO, you'll want to verify it by comparing its md5 hash to the one provided to you on the Ubuntu website; you can view the list of hashes here. Find the hash that corresponds to the ISO that you downloaded earlier. These md5 hashes are 32 character length strings of text that were created by passing the contents of each ISO into the md5 hashing algorithm. If you give the md5 algorithm the exact same input data more than once, it will output the exact same 32 character string every time. This is important because this is how you can be sure that the ISO you downloaded has not been tampered with or corrupted in some way.

For Windows Users

If you're on a Windows machine, you can use winmd5 to verify the ISO's md5 hash. It provides a graphical interface for you, so you don't even need to use your command prompt.

Download the winmd5 program, then run it. Select the ISO file you downloaded earlier. Then, enter the md5 hash provided to you from the Ubuntu website in the bottom text field. After the hash has been computed for the ISO file, push the verify button to compare them. If they match, congratulations! You've just successfully verified the ISO file. You can now move on to the next step.

For Linux Users

If you're using some flavor of Linux, you can use the md5sum program to check the md5 hash of the ISO. Navigate to the directory in which you stored the ISO, then run the following command in your terminal:

md5sum ubuntu-14.04-desktop-amd64.iso

The name of the ISO file may be different, so just replace the one above with the file name of the ISO you downloaded earlier.

This may take a little bit of time to process, depending upon the speed of your computer.

Once you've created an md5 hash from the contents of the ISO, compare it to the one you downloaded from the Ubuntu website. If they match, congratulations! You've just successfully verified the ISO file. You can now move on to the next step.

Step 3: Create a Bootable USB Flash Drive

Before you start writing anything to the flash drive, you'll need to prep it by creating two separate partitions with the correct file system format for each.

For Windows

If you're on Windows, you can find a good tutorial for how to use a program called "diskpart" to partition your flash drive here.

Be sure to create two separate partitions on the flash drive as follows:

  • 2048 MB of space, ext4 file system format, and the label "Ubuntu"; this partition is the one on which we will install the Ubuntu bootloader.
  • The rest of the remaining space, NTFS file system format, and the label "Storage"; this partition will be used to store extra files.

For Linux

If you're on a Linux machine, you can use "GParted" to partition your flash drive; here's a helpful tutorial to guide you through the process if you haven't ever done it before.

Be sure to create two separate partitions on the flash drive as follows:

  • 2048 MB of space, ext4 file system format, and the label "Ubuntu"; this partition is the one on which we will install the Ubuntu bootloader.
  • The rest of the remaining space, ext4 file system format, and the label "Storage"; this partition will be used to store extra files.

Creating the Bootloader

With the flash drive partitioned and ready to go, we can move on to creating the bootloader. Download UNetbootin for your operating system. This program will allow you to create a bootable USB flash drive from the ISO you downloaded earlier. Once you've got it downloaded, start it up.

Select "Diskimage" and browse to select the ISO file you downloaded previously. Then select the "Ubuntu" partition on the USB flash drive to which the bootloader will be installed. Now, where it says "Space used to preserve files across reboots (Ubuntu only)", enter 512 MB. This will allow changes to persist between uses of the bootable USB drive. Finally, click the "OK" button to begin the creation of your bootloader. This may take a few minutes.

If you have trouble with this step, you can try here for additional information about creating bootable USB flash drives.

Before moving on to the next step, you may want to save this tutorial as an HTML document to the "Storage" partition on the flash drive. This will allow you to view it offline from within the Ubuntu OS later.

Step 4: Booting into Ubuntu

Before your machine can boot up using the bootloader installed on the flash drive, you'll need to adjust your machine's boot order in its BIOS. To do this, first restart your computer, but before it boots into your regular, installed operating system, you'll need to open the BIOS menu. Usually this requires you to press the F2 key early on in the boot process. The key to start the BIOS menu may be different for your hardware. Watch carefully when your computer is booting up for instructions for how to get to the BIOS menu.

Once you've reached the BIOS, navigate to the "Boot" or "Boot Order" sub-menu. Then move the USB media up in the boot order until it is above your primary storage device (which is usually a HDD or SSD). Now you can "Save & Exit" from the BIOS.

With the flash drive still plugged into one of your machine's USB ports, your machine should now automatically boot into the Ubuntu OS boot screen. If it didn't, you'll want to look back over the last couple steps to verify you did everything correctly.

Select the "Try Ubuntu" option and hit enter. It might take a minute or two to finish starting. Once you're at the Ubuntu desktop, you can move on to the next step.

Step 5: Install KeePassX Password Manager

Later in this tutorial you will need a secure way to store sensitive information such as passwords. A great way to secure your passwords is to use a password manager like KeePassX. To install it we're going to need to use the Ubuntu terminal program. You can find the terminal program via the Unity Dashboard by clicking on the Ubuntu logo in the upper left corner of the screen. Then type "terminal" into the search box. Once you see the terminal program icon, left-click it to open the terminal:

With the terminal window open, enter the following commands:

sudo add-apt-repository universe
sudo apt-get update

This will allow you to install packages and programs that are maintained by the open source developer community.

Now you can install KeePassX. Enter the following command in the terminal window:

sudo apt-get install keepassx

Yup, it's that easy!

Step 6: Install Electrum

To install Electrum, we're first going to need to install its dependencies. Enter the following in the terminal window:

sudo apt-get install python-qt4 python-pip python-slowaes

Now you should be able to install Electrum by entering the following in the terminal window:

sudo pip install https://download.electrum.org/Electrum-1.9.8.tar.gz#md5=e3918fec0254267f08e41a1fb8691382

The above command was correct as of the time this article was written. You may want to check the Electrum download page to be sure you're installing the latest stable version of Electrum.

Once you've finished installing Electrum, move on to the next step.

Step 7: Disconnect Your Machine from the Internet

Un-plug your ethernet cable, if there is one.

You'll also want to disable your wireless adapter, if you have one. To do this, you'll need to open the BIOS menu again. Once you're in the BIOS menu, navigate through the different sub-menus until you find a reference to your wireless adapter. Disable the wireless adapter. "Save & Exit" from the BIOS.

Step 8: Boot into Ubuntu Again

Now you'll want to boot back into the Ubuntu OS on the flash drive. Once Ubuntu has started, verify that your machine is in fact disconnected from the internet. Look in the upper right corner for the network icon. Any active wired/wireless network connections will show up there.

Step 9: Time to Create Your Wallet

Open up KeePassX. Start a "New Database". You will be prompted to enter a "Master Password". A strong password should consist of alphanumeric characters as well as some non-alphanumeric characters, and it should be at least 20 characters long. This password should be unique. Do not use this password for anything else! Write the master password down on a piece of paper and store it some place safe. Do not save it unencrypted to the flash drive or to any electronic device.

Save the KeePassX database to the "Storage" partition on the flash drive. It is safe to do this, because the file is encrypted with the master password. Now that the password database is setup, you can start saving important things in it. KeePassX allows you to create groups and sub-groups to help organize your passwords. Feel free to organize your password database however you like.

Leave KeePassX open, you're going to need it in a bit.

Start Electrum. The first time you start Electrum, you will be presented with a few options:

Select the option to "Create new wallet" and click the "Next" button. On the next screen, you will be presented with your new wallet's "seed":

Highlight and copy the seed. Navigate back to KeePassx. Save the seed as a new entry. Give it a useful name, so you know what it is. Don't forget to save the password database after each change you make. Once you're done, you can go ahead and hit the "Next" button in Electrum. On the next screen, enter the seed again to confirm that you saved it properly.

Now you will be prompted to enter a password. This password will be used to encrypt the wallet. This time, try using KeePassX's password generator to create a really strong password. A password with 128 characters should do nicely. And again, don't forget to save the KeePassX password database.

It may be a good idea to create multiple backup copies of the password database on other physical devices, in case the flash drive gets lost or damaged. You don't have to backup the wallet file because you can always restore the wallet from the wallet's seed and password.

Clean Up

Shut down your machine and make sure that it is completely powered off. If it's a laptop, take the battery out. Leave the machine sitting like this for at least a minute.

Now you should be able to re-enable your wireless adapter and/or plug the ethernet cable back in, to allow your machine to connect to the internet once again. To allow your machine to boot back into your regular OS, you can either detach any/all USB flash drives from its USB ports or you can re-adjust the boot order in your machine's BIOS to have the USB flash drive lower in the boot order than your HDD/SSD. Keep in mind that anytime you wish to use the bootable Ubuntu USB drive you'll have to update your machine's boot order to allow it to boot from the flash drive. A bit of a pain, but it works.

Congratulations! After all that, you now have a safe and secure Electrum wallet that you can use by booting into the Ubuntu OS that lives on the flash drive. And you can rest easy knowing that your bitcoins will be safe and happy from now on.