# Installing a license when AMPL is read-only

**URL:** <https://discuss.ampl.com/t/installing-a-license-when-ampl-is-read-only/864>\
**Category:** Support\
**Created:** [December 19, 2023, 8:45pm UTC](https://discuss.ampl.com/t/installing-a-license-when-ampl-is-read-only/864 "2023-12-19T20:45:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cumthsc](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/cumthsc/32/93_2.png) [@cumthsc](https://discuss.ampl.com/u/cumthsc)\
**Post date:** [December 19, 2023, 8:45pm UTC](https://discuss.ampl.com/t/installing-a-license-when-ampl-is-read-only/864/1 "2023-12-19T20:45:06Z")

</div>

I found the instructions for installing AMPL Community Edition in a non-writeable directory to be somewhat incomplete and confusing. It took me a couple of tries to figure out exactly what had to be where when installing the license. Here’s how I finally got it to work. This way, multiple users on the same machine can share the AMPL software, and each can get their own license.

I installed AMPL on a Linux system in the /opt directory, which is not writeable by normal users. To install the license, I followed these steps:

1. Unpack the AMPL tarball into /opt. (This step is done once as root. The remaining steps are done by each user.)
2. Define environment variables to point to a writeable directory in my home directory (`export AMPL_LICFILE=${HOME}/.ampl/ampl.lic; export AMPLKEY_RUNTIME_DIR=${HOME}/.ampl`). Add those definitions to your .bash\_profile.
3. Copy the provided license file into the specified location (`cp /opt/ampl.linux-intel64/ampl.lic ${HOME}/.ampl/`).
4. Run AMPL from the license directory (`cd ${HOME}/.ampl; /opt/ampl.linux-intel64/ampl`)
5. Run the shell command as described in the installation instructions.

Hope somebody finds that useful.

---

<div class="post-metadata">

**Author:** ![fdabrandao](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/fdabrandao/32/63_2.png) [@fdabrandao](https://discuss.ampl.com/u/fdabrandao)\
**Post date:** [December 20, 2023, 6:51pm UTC](https://discuss.ampl.com/t/installing-a-license-when-ampl-is-read-only/864/2 "2023-12-20T18:51:47Z")

</div>

Hi @cumthsc,

Thank you for the feedback. We have just updated the instructions ([How to install AMPL — AMPL Resources](https://dev.ampl.com/ampl/install.html#linux)) for read-only instructions for the read-only installations based on what you mentioned. We added the following instructions:

1. Unpack the AMPL tarball into `/opt` as root user. The executables should then be at  
`/opt/ampl.linux-intel64/`.
2. For each user that wants to use this AMPL installation with his own license:
  1. Define environment variables to point to a writeable directory in the user home directory:

```bash
    export AMPL_LICFILE=$HOME/.ampl/ampl.lic
    export AMPLKEY_RUNTIME_DIR=$HOME/.ampl
    export PATH=/opt/ampl.linux-intel64/:$PATH

```

and add those definitions to the `.bash_profile` or `.bashrc` of each user.
  2. Start a new terminal in order to load the new environment variable definitions.
  3. Run the `amplkey activate --uuid <license-uuid>` command in the terminal.
