# Thumbor 6.7.5 > Ubuntu 18.04+ > DigitalOcean ## Packages <pre>apt-get update && apt-get -y upgrade && apt-get -y autoremove && apt-get install -y -q git curl libjpeg-turbo-progs graphicsmagick libgraphicsmagick++3 libgraphicsmagick++1-dev libgraphicsmagick-q16-3 zlib1g-dev libboost-python-dev ffmpeg python-pip pngquant supervisor libcurl4-openssl-dev libssl-dev nginx gifsicle && apt-get clean</pre> ## Python Packages <pre> pip install --upgrade pip hash -r pip </pre> `nano requirements.txt` <pre>thumbor==6.7.5 tc-aws==6.2.12 botocore==1.12.199 opencv-python==4.1.0.25 thumbor-plugins==0.2.2 python-magic==0.4.15 envtpl==0.6.0 dateutils==0.6.6 numpy==1.16.4 raven==6.10.0 argparse==1.4.0 pyres==1.5 pgmagick==0.7.4 graphicsmagick-engine==0.1.1</pre> `pip install -r requirements.txt` ## Pillow Fix <pre>PILLOW_VERSION=$(python -c 'import PIL; print(PIL.__version__)') ; \ if [ -z "$SIMD_LEVEL" ]; then \ CC="cc" && PILLOW_PACKET="pillow" && PILLOW_VERSION_SUFFIX="" ;\ else \ CC="cc -m$SIMD_LEVEL" && PILLOW_PACKET="pillow-SIMD" && PILLOW_VERSION_SUFFIX=".post99" ;\ PILLOW_VERSION="5.2.0" ; \ fi ; \ pip uninstall -y pillow || true && \ CC=$CC \ LIB=/usr/lib/x86_64-linux-gnu/ \ INCLUDE=/usr/include/x86_64-linux-gnu/ \ pip install --no-cache-dir -U --force-reinstall --no-binary=:all: "${PILLOW_PACKET}<=${PILLOW_VERSION}${PILLOW_VERSION_SUFFIX}" --global-option="build_ext" --global-option="--enable-lcms" --global-option="build_ext" --global-option="--enable-zlib" --global-option="build_ext" --global-option="--enable-jpeg" --global-option="build_ext" --global-option="--enable-tiff" </pre> ## Nginx Conf `nano /etc/nginx/sites-enabled/default` <pre> upstream thumbor { server 127.0.0.1:8000; server 127.0.0.1:8001; server 127.0.0.1:8002; server 127.0.0.1:8003; } server { listen 80; server_name _; merge_slashes off; location / { proxy_pass http://thumbor; proxy_redirect off; } access_log off; error_log off; location ~ /\. { deny all; } location = /robots.txt { deny all; } } </pre> ## Configure Thumbor `mkdir .aws` `nano .aws/credentials` <pre> [default] aws_access_key_id = aws_secret_access_key = </pre> `thumbor-config > /etc/thumbor.conf` `nano /etc/thumbor.conf` <pre>ENGINE_THREADPOOL_SIZE = 4 SECURITY_KEY = '' AUTO_WEBP = True ALLOW_OLD_URLS = False ALLOW_UNSAFE_URL = False AUTO_PNG_TO_JPG = True ALLOW_ANIMATED_GIFS = True HEALTHCHECK_ROUTE = '/healthcheck' DETECTORS = [ 'thumbor.detectors.face_detector', 'thumbor.detectors.feature_detector', 'thumbor.detectors.glasses_detector', 'thumbor.detectors.profile_detector' ] OPTIMIZERS = [ 'thumbor_plugins.optimizers.pngquant' ] PNGQUANT_PATH = '/usr/bin/pngquant' TC_AWS_REGION='nyc3' TC_AWS_ENDPOINT='https://nyc3.digitaloceanspaces.com' TC_AWS_STORAGE_RRS=False TC_AWS_ENABLE_HTTP_LOADER=False TC_AWS_ALLOWED_BUCKETS=False TC_AWS_STORE_METADATA=True STORAGE = 'tc_aws.storages.s3_storage' STORAGE_EXPIRATION_SECONDS = 86400 * 365 TC_AWS_STORAGE_BUCKET='' TC_AWS_STORAGE_ROOT_PATH='storage' RESULT_STORAGE = 'tc_aws.result_storages.s3_storage' RESULT_STORAGE_EXPIRATION_SECONDS = 86400 * 365 TC_AWS_RESULT_STORAGE_BUCKET='' TC_AWS_RESULT_STORAGE_ROOT_PATH='results'</pre> ## Configure Supervisor `nano /etc/supervisor/conf.d/thumbor.conf` <pre>[program:thumbor] command=thumbor --port=80%(process_num)02d --conf=/etc/thumbor.conf --log-level=error process_name=thumbor80%(process_num)02d numprocs=4 user=root autostart=true autorestart=true startretries=3 stopsignal=TERM stdout_logfile=/var/log/supervisor/thumbor800%(process_num)s.stdout.log stdout_logfile_maxbytes=1MB stdout_logfile_backups=3 stderr_logfile=/var/log/supervisor/thumbor800%(process_num)s.error.log stderr_logfile_maxbytes=1MB stderr_logfile_backups=3</pre>