Downloading and installing Stata on Linux

If you are a Linux user you a probably already pretty computer savvy. This blog is to share with you how you can install Stata 17 onto a Linux computer.

Step 1: Download Stata

Go to https://download.stata.com/download. The following screen will show.

We will have sent you a username and password in the email we sent you. That email also has your serial number in it.

Fill in the information, including the Stata serial number with which is on your Stata licence file. When you have entered the information click on “Log in”.

Please note that Stata is now only available for 64-bit architecture and you will require a 64-bit computer running 64-bit Linux to be able to successfully install Stata on your device.

The download is a tar.gz file. Download the file to your favourite download location on your drive.

Step 2: Installing Stata

Now that you have the download you need to make the directories for it to be stored in.

1. Make a directory into which the tar.gz file can be expanded, for example:

sudo mkdir /home/user1/temp/statadl

2. Go ahead and move the Stata download file into this directory with the command (replace XX with the version you have downloaded):

sudo mv /home/user1/downloads/StataXXLinux64.tar.gz /home/user1/temp/statadl/StataXXLinux64.tar.gz

3. Expand the tar.gz file with the command:

tar -zxvf StataXXLinux64.tar.gz

This will create the following items in the /statadl/ directory

4. Make a directory for Stata with the command:

sudo mkdir /usr/local/Stata

5. Now run the command to install Stata:

sudo /home/user1/temp/statadl/install

Step 3: Initialising Stata

Now that you have Stata installed on your computer you need to initialise it. This uses the Serial Number, the Code and Authorisation that are included on the licence PDF that was attached to the email we sent you.

To initialise Stata run the command:

sudo /usr/local/Stata/stinit

This runs a script with several questions. These are:

Have you read the Software License Agreement?

Do you agree to the License terms?

Please enter your serial number.

Please enter your licence code.

Please enter your authorisation.

Please enter your organisation name.

Please enter your location.

It will then be complete.

Note: I have used sudo with each of the commands here to ensure that I had write permission on the directories.

To run Stata in Linux you have two options:

1. Running it from the Linux command line using the command:

./stata (if you have Stata/BE)

./stata-se (if you have Stata/SE) or

./stata-mp (if you have Stata/MP)

2. Running Stata with a graphical user interface using the command:

./xstata (if you have Stata/BE)

./stata-se (if you have Stata/SE)

./stata-mp (if you have Stata/MP)