Use a carpet cement specially formulated for bonding carpet strips to a concrete surface. The glue may have the word "tackless" in its name and/or will state that it is for bonding carpet strips and other related items to concrete surfaces. Carpet cement is available at hardware and home improvement stores.
Carpet cement bonds within 24 hours and doesn't require a catalyst or other mixing agent. The glue also dries clear and permits immediate stretching of your carpet.
The glue is highly flammable and should not be used around an open flame or any source of heat. Wear a nose mask and safety goggles when using carpet cement and work in a well-ventilated area.
Read and follow all directions and recommendations on the glue's packaging, and dispose of its empty container in your home's outdoor trash can. Do not burn or dispose of the packaging in an open fire pit, fireplace or other area containing heat and/or fire.
Use a wide brush or trowel to apply the glue to the carpet tack strip and the area of the concrete you want to adhere the strip to. Let the glue applications on the strip and floor dry separately for 24 hours; then place the strip to the concrete and tap with a small wooden block or hammer to activate the carpet cement and form a bond between the two surfaces.
The 24-hour "cure" time ensures a strong bond that is also removable if you should want to take up the carpet in the future. If you prefer a nonremovable bond, connect the surfaces while the glue is wet.