=======================================================
Install/Update/Uninstall Anaconda Repository (AER 2.27)
=======================================================

.. raw:: html

    <p>Full support is included with your purchase of Anaconda Repository.
    If you have any questions during installation, please contact your sales representative
    or <a class="reference external" href="http://continuum.io/support">Priority Support team</a>.</p>
    <p>You may also wish to see the instructions to <a class="reference internal" href="update-uninstall.html"><em>update or uninstall Anaconda
    Repository</em></a>.</p>
    <div class="section" id="id1">
    <h2>Install Anaconda Repository<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
    <p>Your server must meet the requirements for hardware, software, security, and network.
    Please review and verify all your <a class="reference internal" href="requirements.html"><em>Anaconda Repository requirements</em></a>
    before beginning your installation.</p>
    </div>
    <div class="section" id="install-summary">
    <h2>Install summary<a class="headerlink" href="#install-summary" title="Permalink to this headline">¶</a></h2>
    <ol class="arabic simple">
    <li>Install MongoDB 2.6</li>
    <li>Create the Anaconda Repository administrator account</li>
    <li>Install Anaconda Repository packages</li>
    <li>Configure Anaconda Repository</li>
    <li>Start and log on to Anaconda Repository</li>
    <li>Set up automatic restart on reboot, fail or error</li>
    <li>Client configuration</li>
    <li>Install Anaconda Repository license</li>
    <li>(Optional) Mirror installers for Anaconda and Miniconda</li>
    <li>Mirror Anaconda Cloud</li>
    </ol>
    </div>
    <div class="section" id="install-mongodb-2-6">
    <h2>1. Install MongoDB 2.6<a class="headerlink" href="#install-mongodb-2-6" title="Permalink to this headline">¶</a></h2>
    <p>In a terminal window, create the yum repo file as the root user:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>RPM_CDN=&quot;https://820451f3d8380952ce65-4cc6343b423784e82fd202bb87cf87cf.ssl.cf1.rackcdn.com&quot;
    curl -O $RPM_CDN/nginx-1.6.2-1.el6.ngx.x86_64.rpm
    curl -O $RPM_CDN/mongodb-org-tools-2.6.8-1.x86_64.rpm
    curl -O $RPM_CDN/mongodb-org-shell-2.6.8-1.x86_64.rpm
    curl -O $RPM_CDN/mongodb-org-server-2.6.8-1.x86_64.rpm
    curl -O $RPM_CDN/mongodb-org-mongos-2.6.8-1.x86_64.rpm
    curl -O $RPM_CDN/mongodb-org-2.6.8-1.x86_64.rpm
    </pre></div>
    </div>
    <p>NOTE: Ubuntu users use apt-get instead of yum.</p>
    <div class="section" id="mongodb-for-redhat-and-centos-6-7">
    <h3>MongoDB for Redhat and CentOS 6.7+<a class="headerlink" href="#mongodb-for-redhat-and-centos-6-7" title="Permalink to this headline">¶</a></h3>
    <p>Install MongoDB:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo yum install -y mongodb-org*
    </pre></div>
    </div>
    <p>Start MongoDB:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo service mongod start
    </pre></div>
    </div>
    <p>Verify that MongoDB is running:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo service mongod
    Usage: /etc/init.d/mongod COMMAND
    </pre></div>
    </div>
    </div>
    <div class="section" id="mongodb-for-ubuntu-12-04">
    <h3>MongoDB for Ubuntu 12.04+<a class="headerlink" href="#mongodb-for-ubuntu-12-04" title="Permalink to this headline">¶</a></h3>
    <p>Install MongoDB:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

    echo &#39;deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen&#39; | sudo tee /etc/apt/sources.list.d/mongodb.list

    sudo apt-get update

    sudo apt-get install -y mongodb-org=2.6.9 mongodb-org-server=2.6.9 mongodb-org-shell=2.6.9 mongodb-org-mongos=2.6.9 mongodb-org-tools=2.6.9
    </pre></div>
    </div>
    <p>Start MongoDB:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo service mongod start
    </pre></div>
    </div>
    <p>You will receive verification that MongoDB is running:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>start: Job is already running: mongod
    </pre></div>
    </div>
    <p>Note: If you don&#8217;t specify a version like 2.6.9, apt-get will install the latest stable version, which is 3.x.</p>
    </div>
    <div class="section" id="additional-mongodb-resources">
    <h3>Additional MongoDB resources<a class="headerlink" href="#additional-mongodb-resources" title="Permalink to this headline">¶</a></h3>
    <p>For additional MongoDB installation information see <a class="reference external" href="https://docs.mongodb.org/manual/">https://docs.mongodb.org/manual/</a></p>
    </div>
    </div>
    <div class="section" id="create-the-anaconda-repository-administrator-account">
    <h2>2. Create the Anaconda Repository administrator account<a class="headerlink" href="#create-the-anaconda-repository-administrator-account" title="Permalink to this headline">¶</a></h2>
    <p>In a terminal window, create a new user account for Anaconda Repository named anaconda-server, and switch to this new account:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo useradd -m anaconda-server
    </pre></div>
    </div>
    <p>The anaconda-server user is the default for installing Anaconda Repository. Any username can be used.</p>
    <p>NOTE: The use of the root user is discouraged.</p>
    <p>Create the following Anaconda Repository directories:</p>
    <p>Anaconda Repository logging directory:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo mkdir -m 0770 /var/log/anaconda-server
    </pre></div>
    </div>
    <p>Anaconda Repository package storage directory:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo mkdir -m 0770 -p /opt/anaconda-server/package-storage
    </pre></div>
    </div>
    <p>Assign the anaconda-server user ownership of these directories:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo chown -R anaconda-server:anaconda-server /var/log/anaconda-server
    sudo chown -R anaconda-server:anaconda-server /opt/anaconda-server/package-storage
    </pre></div>
    </div>
    <p>Switch to the Anaconda Repository administrator account:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo su - anaconda-server
    </pre></div>
    </div>
    </div>
    <div class="section" id="install-ae-pkgs">
    <span id="id2"></span><h2>3. Install Anaconda Repository<a class="headerlink" href="#install-ae-pkgs" title="Permalink to this headline">¶</a></h2>
    <p>Your support representative will provide you with a download URL for the Anaconda Repository
    installer.</p>
    <p>Download and install Anaconda Repository, following the prompts in the installation routine:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>curl &#39;$INSTALLER_URL&#39; &gt; anaconda_repository.sh
    </pre></div>
    </div>
    <p>Run the anaconda_repository.sh script:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>bash anaconda_repository.sh
    </pre></div>
    </div>
    <p>Review and accept the license terms:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>Welcome to Anaconda Repository 2.27.0 (by Continuum Analytics, Inc.)
    In order to continue the installation process, please review the license agreement.
    Please, press ENTER to continue.
    </pre></div>
    </div>
    <p>Once you have reviewed the license terms, approve them:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>Do you approve the license terms? [yes|no] yes
    </pre></div>
    </div>
    <p>Accept the default location or specify an alternative:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span> anaconda_repository will now be installed into this location:
    /home/anaconda-server/repo  -Press ENTER to confirm the location
     -Press CTRL-C to abort the installation
     -Or specify a different location below
      [/home/anaconda-server/repo] &gt;&gt;&gt; /home/anaconda-server/repo&quot; [Press ENTER]
       PREFIX=/home/anaconda-server/repo
       installing: python-2.7.11-0
       ...
       Python 2.7.11 :: Continuum Analytics, Inc.
       creating default environment... installation finished.
    </pre></div>
    </div>
    <p>At the end of the installation routine, update the anaconda-server user&#8217;s path (prepending /home/anaconda-server/repo)
    by answering yes at the prompt to add the install location to your path:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>Do you wish the installer to prepend the anaconda_repository install location to PATH in your /home/anaconda-server/.bashrc ? [yes|no]
    </pre></div>
    </div>
    <p>Type &#8220;yes&#8221; and press ENTER.</p>
    <p>For the new path changes to take effect, exit and restart your terminal session, or source your .bashrc, or start a new bash shell:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>source ~/.bashrc
    </pre></div>
    </div>
    <p>OR:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">bash</span>
    </pre></div>
    </div>
    </div>
    <div class="section" id="configure-anaconda-repository">
    <h2>4. Configure Anaconda Repository<a class="headerlink" href="#configure-anaconda-repository" title="Permalink to this headline">¶</a></h2>
    <p>Now initialize the web server, choose the package storage location, and create the first user.</p>
    <ol class="loweralpha">
    <li><p class="first">Initialize the web server and indicate the filepath for the package storage location:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>anaconda-server-config --init
    anaconda-server-config --set fs_storage_root /opt/anaconda-server/package-storage
    </pre></div>
    </div>
    </li>
    </ol>
    <p>NOTE: The location for file storage can be any location owned by the anaconda-server user that you created in Step 4.</p>
    <ol class="loweralpha" start="2">
    <li><p class="first">Configure the connection to your MongoDB database:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>anaconda-server-config --set MONGO_URL mongodb://localhost
    </pre></div>
    </div>
    </li>
    </ol>
    <p>NOTE: You may also configure an external MongoDB database. See the
    <a class="reference internal" href="advanced.html#connect-to-existing-mongodb-db"><span>advanced installation instructions</span></a>
    for details.</p>
    <ol class="loweralpha" start="3">
    <li><p class="first">If you are not using LDAP or Kerberos authentication, create an initial superuser account for Anaconda Repository:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>anaconda-server-create-user --username &quot;superuser&quot; --password &quot;yourpassword&quot; --email &quot;your@email.com&quot; --superuser
    </pre></div>
    </div>
    </li>
    </ol>
    <p>NOTE: Replace &#8220;superuser&#8221; with a username of your choice, &#8220;yourpassword&#8221; with a password of your choice, and &#8220;<a class="reference external" href="mailto:you&#37;&#52;&#48;youremail&#46;com">you<span>&#64;</span>youremail<span>&#46;</span>com</a>&#8221; with an email address where you wish to receive system email notifications.</p>
    <p>NOTE: To ensure the bash shell does not process any of the characters in this password, limit the password to lower case letters, upper case letters and numbers, with no punctuation. After setup the password can be changed with the web interface.</p>
    <ol class="loweralpha" start="4">
    <li><p class="first">Initialize the Anaconda Repository database:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">anaconda</span><span class="o">-</span><span class="n">server</span><span class="o">-</span><span class="n">db</span><span class="o">-</span><span class="n">setup</span> <span class="o">--</span><span class="n">execute</span>
    </pre></div>
    </div>
    </li>
    </ol>
    <p>NOTE: When upgrading Anaconda Repository for each future version, you will first install the new version, then run:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">anaconda</span><span class="o">-</span><span class="n">server</span><span class="o">-</span><span class="n">db</span><span class="o">-</span><span class="n">setup</span> <span class="o">--</span><span class="n">execute</span>
    </pre></div>
    </div>
    <p>again, and then restart the server.</p>
    <p>NOTE: More configuration options can be controlled with one or more .yaml configuration files. Anaconda Repository reads configuration files from <code class="docutils literal"><span class="pre">/etc/anaconda-server/*.yaml</span></code>, then <code class="docutils literal"><span class="pre">$PREFIX/etc/anaconda-server/*.yaml</span></code>, then from the path specified in the environment variable <code class="docutils literal"><span class="pre">ANACONDA_SERVER_CONFIG</span></code> if it is set and the command line argument <code class="docutils literal"><span class="pre">--config-file</span></code> was not used, then from the path specified in the command line argument <code class="docutils literal"><span class="pre">--config-file</span></code> if it was used. All configuration is merged, and options from files read earlier are overwritten by files read later. If there are multiple files in the same directory, they are read in alphabetical order.</p>
    </div>
    <div class="section" id="start-and-log-on-to-anaconda-repository">
    <h2>5. Start and log on to Anaconda Repository<a class="headerlink" href="#start-and-log-on-to-anaconda-repository" title="Permalink to this headline">¶</a></h2>
    <p>Now you are ready to start Anaconda Repository and then log on using your browser.</p>
    <ol class="loweralpha">
    <li><p class="first">Start the new Anaconda Repository on the Anaconda Repository port:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>anaconda-server --port 8080
    </pre></div>
    </div>
    </li>
    <li><p class="first">Open your browser and log onto Anaconda Repository by visiting <code class="docutils literal"><span class="pre">http://your.anaconda.repository:8080/</span></code> using the superuser account you created in step 5 above.</p>
    </li>
    <li><p class="first">If you are using LDAP or Kerberos authentication, modify your user &#8220;jsmith&#8221; to be a superuser:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>anaconda-server-admin set-superuser &quot;jsmith&quot;
    </pre></div>
    </div>
    </li>
    </ol>
    </div>
    <div class="section" id="set-up-automatic-restart-on-reboot-fail-or-error">
    <h2>6. Set up automatic restart on reboot, fail or error<a class="headerlink" href="#set-up-automatic-restart-on-reboot-fail-or-error" title="Permalink to this headline">¶</a></h2>
    <ol class="loweralpha">
    <li><p class="first">Run the anaconda-server-install-supervisord-config.sh script to configure supervisord management of the Anaconda server and worker processes:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">anaconda</span><span class="o">-</span><span class="n">server</span><span class="o">-</span><span class="n">install</span><span class="o">-</span><span class="n">supervisord</span><span class="o">-</span><span class="n">config</span><span class="o">.</span><span class="n">sh</span>
    </pre></div>
    </div>
    </li>
    </ol>
    <p>This will generate the /home/anaconda-server/repo/etc/supervisord.conf file and add a crontab rule to restart supervisor after each reboot.</p>
    <p>If an error message says that the user is disallowed from using cron and could not add the crontab rule, you can add it manually with sudo. Edit the crontab file:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>sudo crontab -e -u anaconda-server
    </pre></div>
    </div>
    <p>When the file is open for editing, add this entry:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>@reboot /home/anaconda-server/repo/bin/supervisord
    </pre></div>
    </div>
    <ol class="loweralpha" start="2">
    <li><p class="first">Verify that the server is running with:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>supervisorctl status
    </pre></div>
    </div>
    </li>
    </ol>
    <p>If installed correctly, you see:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span>binstar-server RUNNING   pid 10831, uptime 0:00:05
    </pre></div>
    </div>
    </div>
    <div class="section" id="client-configuration">
    <h2>7. Client configuration<a class="headerlink" href="#client-configuration" title="Permalink to this headline">¶</a></h2>
    <p>Follow the <a class="reference internal" href="configuration.html"><em>Client configuration</em></a> instructions so you can use one or more clients to communicate with the server.</p>
    </div>
    <div class="section" id="install-anaconda-repository-license-file">
    <h2>8.  Install Anaconda Repository License file<a class="headerlink" href="#install-anaconda-repository-license-file" title="Permalink to this headline">¶</a></h2>
    <p>In your browser, go to <code class="docutils literal"><span class="pre">http://your.anaconda.repository:8080</span></code>. Follow the onscreen instructions to upload the license file that you received in an email from your sales representative.</p>
    <p>Contact your sales representative or support representative if you cannot find or have any questions about your license.</p>
    <p>After uploading the license file, you will see the login page. Log in using the superuser user and password that you created in Step 5 above.</p>
    <p>TIP: You can view the current license information and upload a new license file by visiting the URL <code class="docutils literal"><span class="pre">http://your.anaconda.repository:8080/admin/license</span></code>.</p>
    <p>Alternate license install: Copy the license file directly into the <code class="docutils literal"><span class="pre">/home/anaconda-server/.continuum</span></code> directory.</p>
    </div>
    <div class="section" id="optional-mirror-installers-for-anaconda-and-miniconda">
    <h2>9. (Optional) Mirror installers for Anaconda and Miniconda<a class="headerlink" href="#optional-mirror-installers-for-anaconda-and-miniconda" title="Permalink to this headline">¶</a></h2>
    <p>Miniconda and Anaconda installers can be served by Anaconda Repository via the static directory located at /home/anaconda-server/repo/lib/python2.7/site-packages/binstar/static/extras.  This is required for Anaconda Cluster integration.  To serve up the latest Miniconda installers for each platform, download them and copy them to the extras directory:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span># miniconda installers
    mkdir -p /tmp/extras
    pushd /tmp/extras
    URL=&quot;https://repo.continuum.io/miniconda/&quot;
    versions=&quot;Miniconda3-latest-Linux-x86_64.sh Miniconda3-latest-MacOSX-x86_64.sh Miniconda3-latest-Windows-x86.exe Miniconda3-latest-Windows-x86_64.exe Miniconda-latest-Linux-x86_64.sh Miniconda-latest-MacOSX-x86_64.sh Miniconda-latest-Windows-x86.exe Miniconda-latest-Windows-x86_64.exe
    &quot;
    for installer in $versions
    do
        curl -O $URL$installer
    done

    # anaconda installers
    URL=&quot;https://repo.continuum.io/archive/&quot;
    versions=&quot;Anaconda3-2.4.1-Linux-x86_64.sh Anaconda3-2.4.1-MacOSX-x86_64.pkg Anaconda3-2.4.1-MacOSX-x86_64.sh Anaconda3-2.4.1-Windows-x86.exe Anaconda3-2.4.1-Windows-x86_64.exe Anaconda2-2.4.1-Linux-x86_64.sh Anaconda2-2.4.1-MacOSX-x86_64.pkg Anaconda2-2.4.1-MacOSX-x86_64.sh Anaconda2-2.4.1-Windows-x86.exe Anaconda2-2.4.1-Windows-x86_64.exe&quot;
    for installer in $versions
    do
        curl -O $URL$installer
    done

    # Move installers into static directory
    popd
    cp -a /tmp/extras /home/anaconda-server/repo/lib/python2.7/site-packages/binstar/static
    </pre></div>
    </div>
    <p>Users can download the installers by using curl:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span># Fill in server name, port, and specific installer for your platform
    curl -s -O http://&lt;your.anaconda.repository&gt;:8080/static/extras/Miniconda-latest-Linux-x86_64.sh
    </pre></div>
    </div>
    </div>
    <div class="section" id="mirror-anaconda-cloud">
    <h2>10. Mirror Anaconda Cloud<a class="headerlink" href="#mirror-anaconda-cloud" title="Permalink to this headline">¶</a></h2>
    <p>Packages can be mirrored from Anaconda Cloud to the local Anaconda Repository via one of two methods: direct download, or via USB drive provided by Continuum Analytics. This document describes the direct download method. Separate instructions are included with a USB drive.</p>
    <p>Mirror the Anaconda Cloud Repository:</p>
    <div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">anaconda</span><span class="o">-</span><span class="n">server</span><span class="o">-</span><span class="n">sync</span><span class="o">-</span><span class="n">conda</span>
    </pre></div>
    </div>
    <p>This command will mirror the anaconda.org repository to the /opt/anaconda-server/package-storage directory.</p>
    <p>NOTE: Due to the size of the Anaconda Cloud repo and depending on the available Internet bandwidth, the mirror process can take hours.</p>
    </div>
    <div class="section" id="for-additional-help">
    <h2>For additional help<a class="headerlink" href="#for-additional-help" title="Permalink to this headline">¶</a></h2>
    <p>Your organization receives <a class="reference external" href="http://continuum.io/support">priority support</a> with your purchase of Anaconda Repository. Please email support at the email address given to you by your sales representative.</p>
    </div>
    <div class="section" id="advanced-topics">
    <h2>Advanced topics<a class="headerlink" href="#advanced-topics" title="Permalink to this headline">¶</a></h2>
    <ul class="simple">
    <li><a class="reference internal" href="advanced.html"><em>Advanced Installation Options</em></a></li>
    <li><a class="reference internal" href="troubleshoot.html"><em>Troubleshooting your Anaconda repository installation</em></a></li>
    <li><a class="reference internal" href="maintenance.html"><em>Maintenance and configuration concerns</em></a></li>
    <li><a class="reference internal" href="user-administration.html"><em>User administration</em></a></li>
    <li><a class="reference internal" href="configuration.html"><em>Client configuration</em></a></li>
    <li><a class="reference internal" href="mirrors.html"><em>Adding a PyPI or Anaconda Mirror</em></a></li>
    <li><a class="reference internal" href="recommended-workflow.html"><em>Recommended Workflow</em></a></li>
    </ul>
    <div class="toctree-wrapper compound">
    </div>
    </div>
    <div class="section" id="did-you-find-what-you-needed-on-this-page">
    <h2>Did you find what you needed on this page?<a class="headerlink" href="#did-you-find-what-you-needed-on-this-page" title="Permalink to this headline">¶</a></h2>
    <p>Please <a class="reference external" href="https://github.com/Anaconda-Platform/support/issues">let us know</a>.</p>
    </div>

.. toctree::
    :hidden:

    advanced
    troubleshoot
    maintenance
    user-administration
    requirements
    configuration
