In this work we addressed the problem how to fabricate self-assembling tubular nanostructures displaying target recognition functionalities. Bacterial flagellar filaments, composed of thousands of flagellin subunits, were used as scaffolds to display single-domain antibodies (nanobodies) on their surface. As a representative example, an anti-GFP nanobody was successfully inserted into the middle part of flagellin replacing the hypervariable surface-exposed D3 domain. A novel procedure was developed to select appropriate linkers required for functional internal insertion. Linkers of various lengths and conformational properties were chosen from a linker database and they were randomly attached to both ends of an anti-GFP nanobody to facilitate insertion. Functional fusion constructs capable of forming filaments on the surface of flagellin-deficient host cells were selected by magnetic microparticles covered by target GFP molecules and appropriate linkers were identified. TEM studies revealed that short filaments of 2–900 nm were formed on the cell surface. ITC and fluorescent measurements demonstrated that the fusion protein exhibited high binding affinity towards GFP. Our approach allows the development of functionalized flagellar nanotubes against a variety of important target molecules offering potential applications in biosensorics and bio-nanotechnology.