AWS container service: set max_map_count

I’m trying to run Elasticsearch on AWS container service. Here the documentation that I’m following:

The vm_map_max_count setting should be set permanently in

  • What are the differences between Kubernetes Pods and Docker Compose(s) (Composures?)
  • Docker compose wait for without sleep command
  • When does Docker write to iptables?
  • How to mount a docker volume while using a windows host?
  • Getting Docker linked containers localhost pointing to host localhost
  • Alternatives to debug a docker + gunicorn app in production
  • $ grep vm.max_map_count /etc/sysctl.conf


    To apply the setting on a live system type: sysctl -w

    Is there any way to set the vm.max_map_count via script? I don’t want to do it manually every time I run a new container.


  • postgres table does not exist from using docker-compose
  • FeignClient call with consul service throws connection refused in docker container
  • Using Docker to build an image for Node, my Express based Node app, MongoDb, and NodeBB, connected via Passport
  • How to set up Cassandra Docker cluster in Marathon with BRIDGE network?
  • Running VirtualBox in Ubuntu in Mac OSX, won't start up
  • cannot ping in a docker container when connected to one wifi
  • 2 Solutions collect form web for “AWS container service: set max_map_count”

    You could still set it permanently in /etc/sysctl.conf as per you’ve mentioned in your Q. Didn’t it work?


    as per this ticket you could set it up as follows:

    sysctl -qw vm.max_map_count=65535

    Hope it helps!

    I found a solution:

    1. create an empty container
    2. Launch an EC2 inside the previous container:
    3. Add the user data ( as follow:
    echo vm.max_map_count=262144 >> /etc/sysctl.conf
    sysctl -w vm.max_map_count=262144

    Now the EC2 instance is properly configured.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.