Numerous archaeological finds show that Allschwil has been a human settlement since the Stone Age. The most important archaeological finds from this era are exhibited today in the local history museum. Various finds from Roman times indicate that there was a Gallo-Roman settlement here. Allschwil was therefore associated with the Roman road station "Arialbinum" by various authorities.
The name Allschwil was documented for the first time in 1033 in the form of "Almswilre" and is generally derived from "Alamannes-vîlare", which can be translated as "hamlet of the Alemanni".
The outbreak of the French Revolution marked the end of episcopal rule in Allschwil. Initially - from 1792 onwards - the community belonged to the Republic of Raurach, then in 1793 it became part of the newly formed Département du Mont Terrible and from 1800 it belonged to the Département du Haut Rhin.
After a collapse of the Napoleonic system, Allschwil - together with Birseck - was assigned to the City of Basel in 1815 at the Congress of Vienna. Since the separatist turmoil and the cantonal separation in 1833 the municipality belonged to the district of Arlesheim in the canton Basel-Landschaft.